### Question:
RedundancyCalculator { @VisibleForTesting boolean segmentContainsServer(LayoutSegment segment, String server) { return segment.getFirstStripe().getLogServers().contains(server); }  Layout updateLayoutAfterRedundancyRestoration(
            List<TransferSegment> segments, Layout initLayout); static boolean canRestoreRedundancy(Layout layout, String server); static boolean canMergeSegments(Layout layout); static boolean canRestoreRedundancyOrMergeSegments(Layout layout, String server); ImmutableList<TransferSegment> createStateList(Layout layout, long trimMark); ImmutableList<TransferSegment> getTrimmedNotRestoredSegments(Layout layout, long trimMark); ImmutableList<TransferSegmentRange> prepareTransferWorkload(
            ImmutableList<TransferSegment> transferSegmentList,
            Optional<Long> committedTail);  }### Answer:
@Test public void testSegmentContainsServer() { LayoutStripe stripe1 = new LayoutStripe(Arrays.asList("localhost", "A", "B")); LayoutStripe stripe2 = new LayoutStripe(Collections.singletonList("C")); LayoutStripe stripe3 = new LayoutStripe(Collections.singletonList("D")); LayoutSegment segment = new LayoutSegment(CHAIN_REPLICATION, 0L, 1L, Arrays.asList(stripe1, stripe2, stripe3)); RedundancyCalculator calculator = new RedundancyCalculator("localhost"); Assert.assertTrue(calculator.segmentContainsServer(segment, "localhost")); stripe1 = new LayoutStripe(Arrays.asList("A", "B")); segment = new LayoutSegment(CHAIN_REPLICATION, 0L, 1L, Arrays.asList(stripe1, stripe2, stripe3)); Assert.assertFalse(calculator.segmentContainsServer(segment, "localhost")); }