### Question:
NodeLayoutGenerator { static boolean isValidServiceSet(Set<String> serviceSet, LayoutConstraint layoutConstraint, Set<String> clusterServices) { return satisfiesCantCoexist(serviceSet, layoutConstraint) && satisfiesMustCoexist(serviceSet, layoutConstraint, clusterServices); } NodeLayoutGenerator(ClusterTemplate clusterTemplate, Set<String> clusterServices,
                             Set<String> allowedHardwareTypes, Set<String> allowedImageTypes); List<NodeLayout> generateNodeLayoutPreferences();  }### Answer:
@Test public void testIsValidServiceSet() { LayoutConstraint layoutConstraint = reactorTemplate.getConstraints().getLayoutConstraint(); Set<String> services = ImmutableSet.of("namenode", "datanode", "regionserver", "nodemanager", "hbasemaster", "reactor", "zookeeper"); Assert.assertTrue(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("datanode", "regionserver", "nodemanager"), layoutConstraint, services)); Assert.assertTrue(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("namenode", "resourcemanager", "hbasemaster"), layoutConstraint, services)); Assert.assertTrue(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("reactor", "zookeeper"), layoutConstraint, services)); Assert.assertTrue(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("reactor"), layoutConstraint, services)); Assert.assertTrue(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("zookeeper"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("datanode"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("datanode", "nodemanager"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("namenode"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("namenode", "resourcemanager"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("namenode", "datanode"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("reactor", "datanode"), layoutConstraint, services)); Assert.assertFalse(NodeLayoutGenerator.isValidServiceSet( ImmutableSet.of("zookeeper", "datanode"), layoutConstraint, services)); }