MathAggregatorFunctions { @Beta public static <T extends Number> Function<Collection<? extends Number>, T> computingMax( Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, Class<T> type) { return computingMax(defaultValueForUnreportedSensors, valueToReportIfNoSensors, TypeToken.of(type)); } private  MathAggregatorFunctions(); @Beta static Function<Collection<? extends Number>, T> computingSum(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, Class<T> type); @Beta static Function<Collection<? extends Number>, T> computingSum(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, TypeToken<T> typeToken); @Beta static Function<Collection<? extends Number>, T> computingAverage(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, Class<T> type); @Beta static Function<Collection<? extends Number>, T> computingAverage(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, TypeToken<T> typeToken); @Beta static Function<Collection<? extends Number>, T> computingMin(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, Class<T> type); @Beta static Function<Collection<? extends Number>, T> computingMin(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, TypeToken<T> typeToken); @Beta static Function<Collection<? extends Number>, T> computingMax(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, Class<T> type); @Beta static Function<Collection<? extends Number>, T> computingMax(
            Number defaultValueForUnreportedSensors, Number valueToReportIfNoSensors, TypeToken<T> typeToken);  }
@Test public void testMax() throws Exception { Function<Collection<? extends Number>, Integer> func = MathAggregatorFunctions.computingMax(null, null, Integer.class); assertEquals(func.apply(MutableList.<Number>of(1, 3, 5)), (Integer)5); assertEquals(func.apply(MutableList.<Number>of(3, null, 1)), (Integer)3); }