Program: 115515
Project: 115515
Buggy source:
/** 
 * 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);
  }
}

Fixed version (ground truth):
/** 
 * Assert application activation
 * @param applicationId
 */
private void assertClusterActivation(String applicationId,int tenantId){
  Application application=ApplicationManager.getApplications().getApplicationByTenant(applicationId,tenantId);
  assertNotNull(String.format("String_Node_Str",applicationId),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",applicationId,serviceUuid),service);
    Cluster cluster=service.getCluster(clusterId);
    assertNotNull(String.format("String_Node_Str",applicationId,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);
  }
}