Program: 115524
Project: 115524
Buggy source:
/** 
 * Assert application activation
 * @param applicationName
 */
private void assertClusterActivation(String applicationName){
  Application application=ApplicationManager.getApplications().getApplication(applicationName);
  assertNotNull(String.format("String_Node_Str",applicationName),application);
  Set<ClusterDataHolder> clusterDataHolderSet=application.getClusterDataRecursively();
  for (  ClusterDataHolder clusterDataHolder : clusterDataHolderSet) {
    String serviceName=clusterDataHolder.getServiceType();
    String clusterId=clusterDataHolder.getClusterId();
    Service service=TopologyManager.getTopology().getService(serviceName);
    assertNotNull(String.format("String_Node_Str",applicationName,serviceName),service);
    Cluster cluster=service.getCluster(clusterId);
    assertNotNull(String.format("String_Node_Str",applicationName,serviceName,clusterId),cluster);
    boolean clusterActive=false;
    for (    ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
      int activeInstances=0;
      for (      Member member : cluster.getMembers()) {
        if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
          if (member.getStatus().equals(MemberStatus.Active)) {
            activeInstances++;
          }
        }
      }
      clusterActive=activeInstances >= clusterDataHolder.getMinInstances();
      if (!clusterActive) {
        break;
      }
    }
    assertEquals(String.format("String_Node_Str",clusterId),clusterActive,true);
  }
}

Fixed version (ground truth):
/** 
 * Assert application activation
 * @param applicationUuid
 */
private void assertClusterActivation(String applicationUuid){
  Application application=ApplicationManager.getApplications().getApplication(applicationUuid);
  assertNotNull(String.format("String_Node_Str",applicationUuid),application);
  Set<ClusterDataHolder> clusterDataHolderSet=application.getClusterDataRecursively();
  for (  ClusterDataHolder clusterDataHolder : clusterDataHolderSet) {
    String serviceUuid=clusterDataHolder.getServiceUuid();
    String clusterId=clusterDataHolder.getClusterId();
    Service service=TopologyManager.getTopology().getService(serviceUuid);
    assertNotNull(String.format("String_Node_Str",applicationUuid,serviceUuid),service);
    Cluster cluster=service.getCluster(clusterId);
    assertNotNull(String.format("String_Node_Str",applicationUuid,serviceUuid,clusterId),cluster);
    boolean clusterActive=false;
    for (    ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
      int activeInstances=0;
      for (      Member member : cluster.getMembers()) {
        if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
          if (member.getStatus().equals(MemberStatus.Active)) {
            activeInstances++;
          }
        }
      }
      clusterActive=activeInstances >= clusterDataHolder.getMinInstances();
      log.info(String.format("String_Node_Str",activeInstances,clusterDataHolder.getMinInstances()));
      if (!clusterActive) {
        break;
      }
    }
    assertEquals(String.format("String_Node_Str",clusterId),clusterActive,true);
  }
}