### Question:
AbsoluteDifferenceInTwoSortedArrays { public static Triple findMinimumDifference(int[] first, int[] second) { if (first == null || first.length == 0) { throw new IllegalArgumentException("First array is null or empty"); } if (second == null || second.length == 0) { throw new IllegalArgumentException("Second array is null or empty"); } if (first.length != second.length) { throw new IllegalArgumentException("Arrays have different sizes"); } int diff = Integer.MAX_VALUE; int i = 0; int j = 0; int posInFirst = 0; int posInSecond = 0; while (i < first.length && j < second.length) { if (diff > Math.abs(first[i] - second[j])) { diff = Math.abs(first[i] - second[j]); posInFirst = i; posInSecond = j; } if (first[i] <= second[j]) { i++; } else { j++; } } return new Triple(diff, posInFirst, posInSecond); }  static Triple findMinimumDifference(int[] first, int[] second);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testFindMinimumDifferenceFirstIsNull() { findMinimumDifference(null, new int[]{1, 2, 3}); }
@Test(expected = IllegalArgumentException.class) public void testFindMinimumDifferenceSecondIsNull() { findMinimumDifference(new int[]{1, 2, 3}, null); }
@Test(expected = IllegalArgumentException.class) public void testFindMinimumDifferenceBothAreNull() { findMinimumDifference(null, null); }
@Test(expected = IllegalArgumentException.class) public void testFindMinimumDifferenceDifferentLength() { findMinimumDifference(new int[]{1, 2, 3, 4}, new int[]{2, 4, 5}); }
@Test public void testFindMinimumDifference1() { Triple res = findMinimumDifference(new int[]{1}, new int[]{2}); assertThat(res, is(new Triple(1, 0, 0))); }
@Test public void testFindMinimumDifference2() { Triple res = findMinimumDifference(new int[]{1, 2}, new int[]{2, 3}); assertThat(res, is(new Triple(0, 1, 0))); }
@Test public void testFindMinimumDifference3() { Triple res = findMinimumDifference(new int[]{1, 5, 10, 17}, new int[]{18, 19, 25, 27}); assertThat(res, is(new Triple(1, 3, 0))); }
@Test public void testFindMinimumDifference4() { Triple res = findMinimumDifference(new int[]{1, 2, 3, 4}, new int[]{2, 4, 5, 7}); assertThat(res, is(new Triple(0, 1, 0))); }