@Test public void testCount() { List<DatasetMetricsServiceMyBatis.Count<String>> counts = Lists.newArrayList(); counts.add(new DatasetMetricsServiceMyBatis.Count<String>("c", 19)); counts.add(new DatasetMetricsServiceMyBatis.Count<String>("d", 9)); counts.add(new DatasetMetricsServiceMyBatis.Count<String>("b", 229)); counts.add(new DatasetMetricsServiceMyBatis.Count<String>("few", 3214129)); counts.add(new DatasetMetricsServiceMyBatis.Count<String>("a", -4)); counts.add(new DatasetMetricsServiceMyBatis.Count<String>("g", -4)); Collections.sort(counts); assertEquals("g", counts.get(5).getKey()); assertEquals("a", counts.get(4).getKey()); assertEquals("d", counts.get(3).getKey()); assertEquals("c", counts.get(2).getKey()); assertEquals("b", counts.get(1).getKey()); assertEquals("few", counts.get(0).getKey()); }
@Override public DatasetMetrics get(UUID datasetKey) { return mapper.get(datasetKey); }
DatasetMetricsServiceMyBatis implements DatasetMetricsService { @Override public DatasetMetrics get(UUID datasetKey) { return mapper.get(datasetKey); } }
DatasetMetricsServiceMyBatis implements DatasetMetricsService { @Override public DatasetMetrics get(UUID datasetKey) { return mapper.get(datasetKey); } @Inject  DatasetMetricsServiceMyBatis(DatasetMetricsMapper mapper); }
DatasetMetricsServiceMyBatis implements DatasetMetricsService { @Override public DatasetMetrics get(UUID datasetKey) { return mapper.get(datasetKey); } @Inject  DatasetMetricsServiceMyBatis(DatasetMetricsMapper mapper); @Override DatasetMetrics get(UUID datasetKey); DatasetMetrics create(UUID datasetKey, Date downloaded); @Override List<DatasetMetrics> list(UUID datasetKey); }
DatasetMetricsServiceMyBatis implements DatasetMetricsService { @Override public DatasetMetrics get(UUID datasetKey) { return mapper.get(datasetKey); } @Inject  DatasetMetricsServiceMyBatis(DatasetMetricsMapper mapper); @Override DatasetMetrics get(UUID datasetKey); DatasetMetrics create(UUID datasetKey, Date downloaded); @Override List<DatasetMetrics> list(UUID datasetKey);  }