### Question:
PipelinePlacementPolicy extends SCMCommonPlacementPolicy { DatanodeDetails fallBackPickNodes( List<DatanodeDetails> nodeSet, List<DatanodeDetails> excludedNodes) throws SCMException{ DatanodeDetails node; if (excludedNodes == null || excludedNodes.isEmpty()) { node = chooseNode(nodeSet); } else { List<DatanodeDetails> inputNodes = nodeSet.stream() .filter(p -> !excludedNodes.contains(p)).collect(Collectors.toList()); node = chooseNode(inputNodes); } if (node == null) { String msg = String.format("Unable to find fall back node in" + " pipeline allocation. nodeSet size: {}", nodeSet.size()); LOG.warn(msg); throw new SCMException(msg, SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE); } return node; } PipelinePlacementPolicy(final NodeManager nodeManager,
      final PipelineStateManager stateManager, final ConfigurationSource conf); @Override List<DatanodeDetails> chooseDatanodes(
      List<DatanodeDetails> excludedNodes, List<DatanodeDetails> favoredNodes,
      int nodesRequired, final long sizeRequired); @Override List<DatanodeDetails> getResultSet(
      int nodesRequired, List<DatanodeDetails> healthyNodes); @Override DatanodeDetails chooseNode(
      List<DatanodeDetails> healthyNodes); static final String MULTIPLE_RACK_PIPELINE_MSG; }### Answer:
@Test public void testFallBackPickNodes() { List<DatanodeDetails> healthyNodes = overWriteLocationInNodes( nodeManager.getNodes(HddsProtos.NodeState.HEALTHY)); DatanodeDetails node; try { node = placementPolicy.fallBackPickNodes(healthyNodes, null); Assert.assertNotNull(node); } catch (SCMException e) { Assert.fail("Should not reach here."); } List<DatanodeDetails> exclude = healthyNodes; try { node = placementPolicy.fallBackPickNodes(healthyNodes, exclude); Assert.assertNull(node); } catch (SCMException e) { Assert.assertEquals(SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE, e.getResult()); } catch (Exception ex) { Assert.fail("Should not reach here."); } }