### Question:
Reduction { public static boolean threeSum(int[] A) { return FourSum.solveInN2(null); }  static boolean threeSum(int[] A); static boolean threeLinear(int[] A);  }### Answer:
@Test public void basicTest3sum() { assertTrue(Reduction.threeSum(new int[]{2, 1, -3})); assertFalse(Reduction.threeSum(new int[]{2, 1, -2, -2})); assertTrue(Reduction.threeSum(new int[]{-7, 2, 1, -3, 6})); assertFalse(Reduction.threeSum(new int[]{-9, 2, 11, -3, 5, 88})); }
@Test public void randomTest3sum() { int N = 5; for (int i = 0; i < 700; i++) { int m = i % 100; if (m == 99) N <<= 1; int[] input = Shuffler.getRandomArray(N, -m * m, m * m); assertEquals(Arrays.toString(input), ThreeSum.count(input) != 0, Reduction.threeSum(input)); } }