Program: 48842
Project: 48842
Buggy source:
@Test public void testValidateClusterCreate(){
  ClusterCreate cluster=new ClusterCreate();
  cluster.setDistroVendor(Constants.DEFAULT_VENDOR);
  Map<NetTrafficType,List<String>> networkConfig=new HashMap<NetTrafficType,List<String>>();
  List<String> mgtnets=new ArrayList<String>();
  mgtnets.add("String_Node_Str");
  networkConfig.put(NetTrafficType.MGT_NETWORK,mgtnets);
  List<String> hadpnets=new ArrayList<String>();
  hadpnets.add("String_Node_Str");
  networkConfig.put(NetTrafficType.HDFS_NETWORK,hadpnets);
  cluster.setNetworkConfig(networkConfig);
  NodeGroupCreate master=new NodeGroupCreate();
  master.setName("String_Node_Str");
  master.setCpuNum(2);
  master.setMemCapacityMB(7501);
  master.setSwapRatio(0F);
  master.setInstanceNum(1);
  master.setRoles(Arrays.asList(HadoopRole.HADOOP_NAMENODE_ROLE.toString(),HadoopRole.HADOOP_JOBTRACKER_ROLE.toString()));
  NodeGroupCreate worker=new NodeGroupCreate();
  worker.setName("String_Node_Str");
  worker.setRoles(Arrays.asList(HadoopRole.HADOOP_DATANODE.toString(),HadoopRole.HADOOP_TASKTRACKER.toString()));
  worker.setCpuNum(2);
  worker.setMemCapacityMB(3748);
  worker.setInstanceNum(0);
  NodeGroupCreate client=new NodeGroupCreate();
  client.setName("String_Node_Str");
  client.setCpuNum(2);
  client.setMemCapacityMB(3748);
  client.setInstanceNum(0);
  client.setRoles(Arrays.asList(HadoopRole.HADOOP_CLIENT_ROLE.toString(),HadoopRole.HIVE_SERVER_ROLE.toString(),HadoopRole.HIVE_ROLE.toString()));
  List<String> failedMsgList=new ArrayList<String>();
  List<String> warningMsgList=new ArrayList<String>();
  List<String> distroRoles=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  cluster.setNodeGroups(new NodeGroupCreate[]{master,worker,client});
  cluster.validateClusterCreate(failedMsgList,warningMsgList,distroRoles);
  assertEquals(3,failedMsgList.size());
  assertEquals("String_Node_Str",failedMsgList.get(0));
  assertEquals("String_Node_Str",failedMsgList.get(1));
  assertEquals("String_Node_Str",failedMsgList.get(2));
  assertEquals(1,warningMsgList.size());
  assertEquals("String_Node_Str",warningMsgList.get(0));
}

Fixed version (ground truth):
@Test public void testValidateClusterCreate(){
  ClusterCreate cluster=new ClusterCreate();
  cluster.setDistroVendor(Constants.DEFAULT_VENDOR);
  Map<NetTrafficType,List<String>> networkConfig=new HashMap<NetTrafficType,List<String>>();
  List<String> mgtnets=new ArrayList<String>();
  mgtnets.add("String_Node_Str");
  networkConfig.put(NetTrafficType.MGT_NETWORK,mgtnets);
  List<String> hadpnets=new ArrayList<String>();
  hadpnets.add("String_Node_Str");
  networkConfig.put(NetTrafficType.HDFS_NETWORK,hadpnets);
  cluster.setNetworkConfig(networkConfig);
  NodeGroupCreate master=new NodeGroupCreate();
  master.setName("String_Node_Str");
  master.setMemCapacityMB(7501);
  master.setSwapRatio(0F);
  master.setInstanceNum(1);
  master.setRoles(Arrays.asList(HadoopRole.HADOOP_NAMENODE_ROLE.toString(),HadoopRole.HADOOP_JOBTRACKER_ROLE.toString()));
  NodeGroupCreate worker=new NodeGroupCreate();
  worker.setName("String_Node_Str");
  worker.setRoles(Arrays.asList(HadoopRole.HADOOP_DATANODE.toString(),HadoopRole.HADOOP_TASKTRACKER.toString()));
  worker.setMemCapacityMB(3748);
  worker.setInstanceNum(0);
  NodeGroupCreate client=new NodeGroupCreate();
  client.setName("String_Node_Str");
  client.setMemCapacityMB(3748);
  client.setInstanceNum(0);
  client.setRoles(Arrays.asList(HadoopRole.HADOOP_CLIENT_ROLE.toString(),HadoopRole.HIVE_SERVER_ROLE.toString(),HadoopRole.HIVE_ROLE.toString()));
  List<String> failedMsgList=new ArrayList<String>();
  List<String> warningMsgList=new ArrayList<String>();
  List<String> distroRoles=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  cluster.setNodeGroups(new NodeGroupCreate[]{master,worker,client});
  cluster.validateClusterCreate(failedMsgList,warningMsgList,distroRoles);
  assertEquals(3,failedMsgList.size());
  assertEquals("String_Node_Str",failedMsgList.get(0));
  assertEquals("String_Node_Str",failedMsgList.get(1));
  assertEquals("String_Node_Str",failedMsgList.get(2));
  assertEquals(1,warningMsgList.size());
  assertEquals("String_Node_Str",warningMsgList.get(0));
}