@Test public void testIntegerCalculate() throws Exception { MinMax.Pair p1 = new MinMax<>(ARRAY_INT).calculate(); assertEquals(new MinMax<>(null).new Pair(-5, 123), p1); MinMaxStatic.Pair p2 = MinMaxStatic.calculate(ARRAY_INT); assertEquals(new MinMaxStatic.Pair<>(-5, 123), p2); }
public Pair calculate() { return calculate(new Comparator<T>() { @Override public int compare(T o1, T o2) { return ((Comparable<T>) o1).compareTo(o2); } }); }
MinMax { public Pair calculate() { return calculate(new Comparator<T>() { @Override public int compare(T o1, T o2) { return ((Comparable<T>) o1).compareTo(o2); } }); } }
MinMax { public Pair calculate() { return calculate(new Comparator<T>() { @Override public int compare(T o1, T o2) { return ((Comparable<T>) o1).compareTo(o2); } }); } MinMax(T[] array); }
MinMax { public Pair calculate() { return calculate(new Comparator<T>() { @Override public int compare(T o1, T o2) { return ((Comparable<T>) o1).compareTo(o2); } }); } MinMax(T[] array); Pair calculate(); Pair calculate(Comparator<T> cmp); }
MinMax { public Pair calculate() { return calculate(new Comparator<T>() { @Override public int compare(T o1, T o2) { return ((Comparable<T>) o1).compareTo(o2); } }); } MinMax(T[] array); Pair calculate(); Pair calculate(Comparator<T> cmp);  }