Solution { public int[] twoSum(int[] numbers, int target) { for (int i = 0; i < numbers.length; i++) { for (int j = i + 1; j < numbers.length; j++) { int sum = numbers[i] + numbers[j]; if (sum == target) { return new int[]{i + 1, j + 1}; } } } return null; }  int[] twoSum(int[] numbers, int target);  }
@Test public void exampleInput() throws Exception { Solution solution = new Solution(); int[] ints = solution.twoSum(new int[]{2, 7, 11, 15}, 9); assertThat(ints[0], is(1)); assertThat(ints[1], is(2)); }