### Question:
DuplicatedTrackers implements Warning { @Override public boolean active() { int count = 0; Set<Integer> ids = new HashSet<>(); for (SegmentStatus info : trackerInfos) { ids.add(info.getSegmentId()); count++; } return count != ids.size(); } DuplicatedTrackers(Iterable<SegmentStatus> trackerInfos); @Override boolean active(); @Override String message();  }### Answer:
@Test public void testActive() { List<EventProcessorInfo.SegmentStatus> eventTrackerInfoList = asList(newBuilder().setSegmentId(1).build(), newBuilder().setSegmentId(1).build()); Warning warning = new DuplicatedTrackers(eventTrackerInfoList); assertTrue(warning.active()); }
@Test public void testNotActive() { List<EventProcessorInfo.SegmentStatus> eventTrackerInfoList = asList(newBuilder().setSegmentId(2).build(), newBuilder().setSegmentId(3).build()); Warning warning = new DuplicatedTrackers(eventTrackerInfoList); assertFalse(warning.active()); }