PlacementService implements IPlacementService { @Override public List<BaseNode> getBadNodes(ClusterCreate cluster, List<BaseNode> existedNodes) { IPlacementPlanner planner = new PlacementPlanner(); return planner.getBadNodes(cluster, existedNodes); }  @Override List<BaseNode> getPlacementPlan(IContainer container,
         ClusterCreate cluster, List<BaseNode> existedNodes, Map<String, List<String>> filteredHosts); @Override List<BaseNode> getBadNodes(ClusterCreate cluster,
         List<BaseNode> existedNodes); @Override List<DiskSpec> getReplacementDisks(IContainer container,
         ClusterCreate spec, String groupName, String nodeName,
         String targetHost, List<DiskSpec> badDisks,
         Map<String, Integer> dsUsage);  }
@Test public void testGetBadNodes() throws Exception { ClusterCreate cluster = TestPlacementUtil .getSimpleClusterSpec(TestPlacementUtil.DC_SPLIT_CLUSTER_SPEC); List<BaseNode> existedNodes = TestPlacementUtil .getExistedNodes(TestPlacementUtil.EXISTED_NODE_SPEC); PlacementService service = new PlacementService(); List<BaseNode> bads = service.getBadNodes(cluster, existedNodes); Assert.assertTrue(bads.size() == 3, "number of bad nodes should be 3, but it's " + bads.size()); existedNodes.removeAll(bads); TestPlacementUtil.validate(cluster, existedNodes, true); }