AggregateMin extends AbstractAggregate { public IAggregate cloneAggregate() { return new AggregateMin(resultType); } AggregateMin(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 testCloneAggregate() { agg = new AggregateMin(Long.class); assertEquals(Long.class, agg.cloneAggregate().getValueType()); assertEquals(true, agg.cloneAggregate() instanceof AggregateMin); }