@Test
public void testTopUsers() throws Exception {

  long[] ids = new long[100];
  for (int i = 0; i < 100; i++) {
    ids[i] = i;
  }
  LongPrimitiveIterator possibleItemIds = new LongPrimitiveArrayIterator(ids);
  TopItems.Estimator<Long> estimator = new TopItems.Estimator<Long>() {
    @Override
    public double estimate(Long thing) {
      return thing;
    }
  };
  long[] topItems = TopItems.getTopUsers(10, possibleItemIds, null, estimator);
  int gold = 99;
  for (long topItem : topItems) {
    assertEquals(gold--, topItem);
  }
}