AggregateSumFilter extends AggregateSum { public AggregateSumFilter(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); } setResultType(type); if ((type == Long.class) || (type == long.class)) { setConcreteSum(new AggregateSumLongFilter()); } if ((type == Integer.class) || (type == int.class)) { setConcreteSum(new AggregateSumIntFilter()); } if ((type == Double.class) || (type == double.class)) { setConcreteSum(new AggregateSumDoubleFilter()); } if ((type == Float.class) || (type == float.class)) { setConcreteSum(new AggregateSumFloatFilter()); } if (type == BigDecimal.class) { setConcreteSum(new AggregateSumDecimalFilter()); } } AggregateSumFilter(Class< ? > type); IAggregate cloneAggregate();  }
@Test public void testAggregateSumFilter() { try { agg = new AggregateSumFilter(null); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } try { agg = new AggregateSumFilter(String.class); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } }