Program: 96448
Project: 96448
Buggy source:
@Specification({"String_Node_Str"}) @Test public void shouldNotThrowNullPointerExceptionWhenCloseSessionsIsExecuted() throws Exception {
  k3po.finish();
  ObjectName echoServiceMbeanName=null;
  MBeanServerConnection mbeanServerConn=jmxConnection.getConnection();
  Set<ObjectName> mbeanNames=mbeanServerConn.queryNames(null,null);
  String MBeanPrefix="String_Node_Str" + ECHO_WS_SERVICE + "String_Node_Str";
  for (  ObjectName name : mbeanNames) {
    if (name.toString().indexOf(MBeanPrefix) > 0) {
      echoServiceMbeanName=name;
      break;
    }
  }
  long startTime=currentTimeMillis();
  Long numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  while (numberOfCurrentSessions < 1 && (currentTimeMillis() - startTime) < 10000) {
    Thread.sleep(500);
    numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  }
  assertEquals("String_Node_Str",(Long)1L,numberOfCurrentSessions);
  ObjectName targetService=new ObjectName(echoServiceMbeanName.toString());
  Object[] params={"String_Node_Str","String_Node_Str"};
  String[] signature={String.class.getName(),String.class.getName()};
  mbeanServerConn.invoke(targetService,"String_Node_Str",params,signature);
  startTime=currentTimeMillis();
  numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  while (numberOfCurrentSessions > 1 && (currentTimeMillis() - startTime) < 10000) {
    Thread.sleep(500);
    numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  }
  assertEquals("String_Node_Str",(Long)0L,numberOfCurrentSessions);
  MemoryAppender.assertLogMessages(null,Arrays.asList("String_Node_Str"),null,Arrays.asList(NullPointerException.class),null,false);
}

Fixed version (ground truth):
@Specification({"String_Node_Str"}) @Test public void shouldNotThrowNullPointerExceptionWhenCloseSessionsIsExecuted() throws Exception {
  k3po.finish();
  ObjectName echoServiceMbeanName=null;
  MBeanServerConnection mbeanServerConn=jmxConnection.getConnection();
  Set<ObjectName> mbeanNames=mbeanServerConn.queryNames(null,null);
  String MBeanPrefix="String_Node_Str" + ECHO_WS_SERVICE + "String_Node_Str";
  for (  ObjectName name : mbeanNames) {
    if (name.toString().indexOf(MBeanPrefix) > 0) {
      echoServiceMbeanName=name;
      break;
    }
  }
  long startTime=currentTimeMillis();
  Long numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  while (numberOfCurrentSessions < 1 && (currentTimeMillis() - startTime) < 10000) {
    Thread.sleep(500);
    numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  }
  assertEquals("String_Node_Str",(Long)1L,numberOfCurrentSessions);
  ObjectName targetService=new ObjectName(echoServiceMbeanName.toString());
  Object[] params={"String_Node_Str","String_Node_Str"};
  String[] signature={String.class.getName(),String.class.getName()};
  mbeanServerConn.invoke(targetService,"String_Node_Str",params,signature);
  startTime=currentTimeMillis();
  numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  while (numberOfCurrentSessions > 0 && (currentTimeMillis() - startTime) < 10000) {
    Thread.sleep(500);
    numberOfCurrentSessions=(Long)mbeanServerConn.getAttribute(echoServiceMbeanName,"String_Node_Str");
  }
  assertEquals("String_Node_Str",(Long)0L,numberOfCurrentSessions);
  MemoryAppender.assertLogMessages(null,Arrays.asList("String_Node_Str"),null,Arrays.asList(NullPointerException.class),null,false);
}