Problem4_6 { public static boolean findPair(int[] s1, int[] s2, int x) { Arrays.sort(s2); for (int f : s1) { int s = x - f; if (Arrays.binarySearch(s2, s) >= 0) { return true; } } return false; }  static boolean findPair(int[] s1, int[] s2, int x);  }
@Test public void shouldFindAPair() throws Exception { boolean pair = Problem4_6.findPair(new int[]{4, 3, 7}, new int[]{3, 2, 1}, 5); assertTrue(pair); }