@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()); }
@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 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 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); }
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(); }
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();  }