@Test
public void testServiceDeletion() {

  StackInfo stack = stackManager.getStack("HDP", "2.0.6");
  Collection<ServiceInfo> allServices = stack.getServices();
  assertEquals(12, allServices.size());
  HashSet<String> expectedServices = new HashSet<String>();
  expectedServices.add("GANGLIA");
  expectedServices.add("HBASE");
  expectedServices.add("HCATALOG");
  expectedServices.add("HDFS");
  expectedServices.add("HIVE");
  expectedServices.add("MAPREDUCE2");
  expectedServices.add("OOZIE");
  expectedServices.add("PIG");
  expectedServices.add("SPARK");
  expectedServices.add("ZOOKEEPER");
  expectedServices.add("FLUME");
  expectedServices.add("YARN");
  for (ServiceInfo service : allServices) {
    assertTrue(expectedServices.remove(service.getName()));
  }
  assertTrue(expectedServices.isEmpty());
}