title: unable to resolve java.lang.NullPointerException
body: <p>I have three classes-  class 'ABC' 'PQR' and 'XYZ'</p>
  
  <h3>class ABC</h3>
  
  <pre><code>@Test
  public void getModulesid() throws Exception {
      Long GrpId= PQR.getExistingGroupId();
      System.out.println(GrpId);
  }
  </code></pre>
  
  <h3>class PQR</h3>
  
  <pre><code>public static Long getExistingGroupId() throws Exception {
      Long GrpId;
      List&lt;MsecBusGroups&gt; busGroupsList = new ArrayList&lt;MsecBusGroups&gt;();
      busGroupsList=XYZ.getBusGroups();
      if (busGroupsList!=null){
          MsecBusGroups It1=busGroupsList.get(busGroupsList.size()-1);
          GrpId=It1.getId();
          return GrpId;
      } else {
          throw new Exception("BUSINESS GROUPS LIST RETURNED IS NULL");
      }
  }
  </code></pre>
  
  <h3>class XYZ</h3>
  
  <pre><code>public List&lt;MsecBusGroups&gt; getBusGroups() throws PersistenceException {
  
      final String METHOD_NAME = "getBusGroups()";
      LogHelper.logEntry(CLASS_NAME, METHOD_NAME);
      List&lt;MsecBusGroups&gt; list = null;
      try {
          Query q = em.createNamedQuery("getBusGroups");
          list = q.getResultList();
          if (list == null) {
              LogHelper.debug(CLASS_NAME, METHOD_NAME, "No Record   Found");
          }
      ...
  }
  </code></pre>
  
  <p>When I run the test method in ABC class its throwing <code>java.lang.NullPointerException</code>.</p>
  
  <pre><code>java.lang.NullPointerException
      at com.causeway.platform.security.model.actions.BusServiceActions.getExistingGroupId(BusServiceActions.java:202)
      at com.causeway.platform.security.model.serviceImpl.SecurityBusServiceTest.testDeleteModule(SecurityBusServiceTest.java:1231)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>