@Test
public void testLowRankedElementsIgnored() throws IOException {

  // Insert 5 nodes with 2 peer reports each.
  for (int i = 0; i < 5; ++i) {
    tracker.addReport("node" + i, "reporter1");
    tracker.addReport("node" + i, "reporter2");
  }
  // Insert 10 nodes with 1 peer report each.
  for (int i = 10; i < 20; ++i) {
    tracker.addReport("node" + i, "reporter1");
  }
  final Set<ReportForJson> reports = getAndDeserializeJson();
  // Ensure that only the first 5 nodes with two reports each were
  // included in the JSON.
  for (int i = 0; i < 5; ++i) {
    assertTrue(isNodeInReports(reports, "node" + i));
  }
}