Problem4_2 { public static IntPair maximize_unsorted(int[] numbers) { OptionalInt min = IntStream.of(numbers).min(); OptionalInt max = IntStream.of(numbers).max(); return new IntPair(min.getAsInt(), max.getAsInt()); }  static IntPair maximize_unsorted(int[] numbers); static IntPair maximize_sorted(int[] numbers); static IntPair minimize_unsorted(int[] numbers); static IntPair minimize_sorted(int[] sorted);  }
@Test public void shouldFindPairThatMaximizeWithinUnsortedArray() throws Exception { int[] numbers = {6, 13, 19, 3, 8}; IntPair p = Problem4_2.maximize_unsorted(numbers); assertThat(p, equalTo(new IntPair(3, 19))); }