### Question:
DefaultSlotChainBuilder implements SlotChainBuilder { @Override public ProcessorSlotChain build() { ProcessorSlotChain chain = new DefaultProcessorSlotChain(); List<ProcessorSlot> sortedSlotList = SpiLoader.loadPrototypeInstanceListSorted(ProcessorSlot.class); for (ProcessorSlot slot : sortedSlotList) { if (!(slot instanceof AbstractLinkedProcessorSlot)) { RecordLog.warn("The ProcessorSlot(" + slot.getClass().getCanonicalName() + ") is not an instance of AbstractLinkedProcessorSlot, can't be added into ProcessorSlotChain"); continue; } chain.addLast((AbstractLinkedProcessorSlot<?>) slot); } return chain; }  @Override ProcessorSlotChain build();  }### Answer:
@Test public void testBuild() { DefaultSlotChainBuilder builder = new DefaultSlotChainBuilder(); ProcessorSlotChain slotChain = builder.build(); assertNotNull(slotChain); AbstractLinkedProcessorSlot<?> next = slotChain.getNext(); assertTrue(next instanceof NodeSelectorSlot); NodeSelectorSlot nodeSelectorSlot = (NodeSelectorSlot) next; next = next.getNext(); assertTrue(next instanceof ClusterBuilderSlot); next = next.getNext(); assertTrue(next instanceof LogSlot); next = next.getNext(); assertTrue(next instanceof StatisticSlot); next = next.getNext(); assertTrue(next instanceof AuthoritySlot); next = next.getNext(); assertTrue(next instanceof SystemSlot); next = next.getNext(); assertTrue(next instanceof FlowSlot); next = next.getNext(); assertTrue(next instanceof DegradeSlot); next = next.getNext(); assertNull(next); ProcessorSlotChain slotChain2 = builder.build(); assertNotNull(slotChain2); assertNotSame(slotChain, slotChain2); next = slotChain2.getNext(); assertTrue(next instanceof NodeSelectorSlot); NodeSelectorSlot nodeSelectorSlot2 = (NodeSelectorSlot) next; assertNotSame(nodeSelectorSlot, nodeSelectorSlot2); }