Aggregations implements Serializable { public static <T extends Number & Comparable> Aggregation<T> max(){ return new Max<>(); } private  Aggregations(); static Aggregation<T> max(); static Aggregation<T> min(); static Aggregation<T> sum(); static Aggregation<T> avg();  }
@Test public void max() { Aggregation<Integer> max = Aggregations.max(); max.aggregate(1); max.aggregate(2); max.aggregate(3); max.aggregate(4); max.aggregate(null); double aggregated = max.getAggregated(); Assert.assertEquals(4, aggregated, DELTA); Assert.assertEquals("max", max.getIdentifier()); max.reset(); }
@Test public void maxCloned() { Aggregation<Integer> max = ClonerUtil.clone(Aggregations.max()); max.aggregate(1); max.aggregate(2); max.aggregate(3); max.aggregate(4); max.aggregate(null); double aggregated = max.getAggregated(); Assert.assertEquals(4, aggregated, DELTA); Assert.assertEquals("max", max.getIdentifier()); max.reset(); }