AggregateMax extends AbstractAggregate { public AggregateMax(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } this.resultType = type; this.sortSet = new SortCountedSet<Object>(); } AggregateMax(Class< ? > type); @Override void enter(Object value, boolean filter); @Override void leave(Object value, boolean filter); @Override Object getValue(); @Override void clear(); SortCountedSet<Object> getSortSet(); IAggregate cloneAggregate(); @Override Class< ? > getValueType();  }
@Test public void testAggregateMax() { try { agg = new AggregateMax(null); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } try { agg = new AggregateMax(String.class); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } }