@Test public void subtract() { assertEquals(1, AggregationUtils.subtract(2, 1), delta); assertEquals(1, AggregationUtils.subtract(2L, 1L), delta); assertEquals(1, AggregationUtils.subtract(2F, 1F), delta); assertEquals(1, AggregationUtils.subtract(2D, 1D), delta); assertEquals(1, AggregationUtils.subtract(2D, 1L), delta); }
@SuppressWarnings("unchecked") public static <T extends Number, I extends Number> Double subtract(T o1, I o2){ if(o1 == null || o2 == null){ return null; } return o1.doubleValue() - o2.doubleValue(); }
AggregationUtils implements Serializable { @SuppressWarnings("unchecked") public static <T extends Number, I extends Number> Double subtract(T o1, I o2){ if(o1 == null || o2 == null){ return null; } return o1.doubleValue() - o2.doubleValue(); } }
AggregationUtils implements Serializable { @SuppressWarnings("unchecked") public static <T extends Number, I extends Number> Double subtract(T o1, I o2){ if(o1 == null || o2 == null){ return null; } return o1.doubleValue() - o2.doubleValue(); } private  AggregationUtils(); }
AggregationUtils implements Serializable { @SuppressWarnings("unchecked") public static <T extends Number, I extends Number> Double subtract(T o1, I o2){ if(o1 == null || o2 == null){ return null; } return o1.doubleValue() - o2.doubleValue(); } private  AggregationUtils(); @SuppressWarnings("unchecked") // both types are the same and extends from Comparable static int compare(T o1, I o2); @SuppressWarnings("unchecked") // manually checked type security static Double add(T o1, I o2); @SuppressWarnings("unchecked") // manually checked type security static Double subtract(T o1, I o2); @SuppressWarnings("unchecked") // manually checked type security static Double multiply(T m1, I m2); @SuppressWarnings("unchecked") // manually checked type security static Double divide(T divided, I divider); }
AggregationUtils implements Serializable { @SuppressWarnings("unchecked") public static <T extends Number, I extends Number> Double subtract(T o1, I o2){ if(o1 == null || o2 == null){ return null; } return o1.doubleValue() - o2.doubleValue(); } private  AggregationUtils(); @SuppressWarnings("unchecked") // both types are the same and extends from Comparable static int compare(T o1, I o2); @SuppressWarnings("unchecked") // manually checked type security static Double add(T o1, I o2); @SuppressWarnings("unchecked") // manually checked type security static Double subtract(T o1, I o2); @SuppressWarnings("unchecked") // manually checked type security static Double multiply(T m1, I m2); @SuppressWarnings("unchecked") // manually checked type security static Double divide(T divided, I divider);  }