Diff { public static double[] values(final double[] v) { ArgumentChecker.notNull(v, "v"); final int n = v.length - 1; double[] tmp = new double[n]; for (int i = 0; i < n; i++) { tmp[i] = v[i + 1] - v[i]; } return tmp; }  static double[] values(final double[] v); static double[] values(final double[] v, final int t); static float[] values(final float[] v); static float[] values(final float[] v, final int t); static int[] values(final int[] v); static int[] values(final int[] v, final int t); static long[] values(final long[] v); static long[] values(final long[] v, final int t);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffDoubleNull() { Diff.values(_dataNullDouble); }
@Test public void testDiffDouble() { assertTrue(Arrays.equals(_dataDoubleAnswerDiff1times, Diff.values(_dataDouble))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffDoubleNtimesDoubleNull() { System.out.println(Arrays.toString(Diff.values(_dataNullDouble, 1))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffDoubleNtimesTtooLarge() { System.out.println(Arrays.toString(Diff.values(_dataDouble, 8))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffDoubleNtimesTtooSmall() { System.out.println(Arrays.toString(Diff.values(_dataDouble, -1))); }
@Test public void testDiffDoubleNtimes() { assertTrue(Arrays.equals(_dataDoubleAnswerDiff0times, Diff.values(_dataDouble, 0))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff1times, Diff.values(_dataDouble, 1))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff2times, Diff.values(_dataDouble, 2))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff3times, Diff.values(_dataDouble, 3))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff4times, Diff.values(_dataDouble, 4))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff5times, Diff.values(_dataDouble, 5))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff6times, Diff.values(_dataDouble, 6))); assertTrue(Arrays.equals(_dataDoubleAnswerDiff7times, Diff.values(_dataDouble, 7))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffFloatNull() { Diff.values(_dataNullFloat); }
@Test public void testDiffFloat() { assertTrue(Arrays.equals(_dataFloatAnswerDiff1times, Diff.values(_dataFloat))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffFloatNtimesFloatNull() { System.out.println(Arrays.toString(Diff.values(_dataNullFloat, 1))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffFloatNtimesTtooLarge() { System.out.println(Arrays.toString(Diff.values(_dataFloat, 8))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffFloatNtimesTtooSmall() { System.out.println(Arrays.toString(Diff.values(_dataFloat, -1))); }
@Test public void testDiffFloatNtimes() { assertTrue(Arrays.equals(_dataFloatAnswerDiff0times, Diff.values(_dataFloat, 0))); assertTrue(Arrays.equals(_dataFloatAnswerDiff1times, Diff.values(_dataFloat, 1))); assertTrue(Arrays.equals(_dataFloatAnswerDiff2times, Diff.values(_dataFloat, 2))); assertTrue(Arrays.equals(_dataFloatAnswerDiff3times, Diff.values(_dataFloat, 3))); assertTrue(Arrays.equals(_dataFloatAnswerDiff4times, Diff.values(_dataFloat, 4))); assertTrue(Arrays.equals(_dataFloatAnswerDiff5times, Diff.values(_dataFloat, 5))); assertTrue(Arrays.equals(_dataFloatAnswerDiff6times, Diff.values(_dataFloat, 6))); assertTrue(Arrays.equals(_dataFloatAnswerDiff7times, Diff.values(_dataFloat, 7))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffIntegerNull() { Diff.values(_dataNullInteger); }
@Test public void testDiffInteger() { assertTrue(Arrays.equals(_dataIntegerAnswerDiff1times, Diff.values(_dataInteger))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffIntegerNtimesIntegerNull() { System.out.println(Arrays.toString(Diff.values(_dataNullInteger, 1))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffIntegerNtimesTtooLarge() { System.out.println(Arrays.toString(Diff.values(_dataInteger, 8))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffIntegerNtimesTtooSmall() { System.out.println(Arrays.toString(Diff.values(_dataInteger, -1))); }
@Test public void testDiffIntegerNtimes() { assertTrue(Arrays.equals(_dataIntegerAnswerDiff0times, Diff.values(_dataInteger, 0))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff1times, Diff.values(_dataInteger, 1))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff2times, Diff.values(_dataInteger, 2))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff3times, Diff.values(_dataInteger, 3))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff4times, Diff.values(_dataInteger, 4))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff5times, Diff.values(_dataInteger, 5))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff6times, Diff.values(_dataInteger, 6))); assertTrue(Arrays.equals(_dataIntegerAnswerDiff7times, Diff.values(_dataInteger, 7))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffLongNull() { Diff.values(_dataNullLong); }
@Test public void testDiffLong() { assertTrue(Arrays.equals(_dataLongAnswerDiff1times, Diff.values(_dataLong))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffLongNtimesLongNull() { System.out.println(Arrays.toString(Diff.values(_dataNullLong, 1))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffLongNtimesTtooLarge() { System.out.println(Arrays.toString(Diff.values(_dataLong, 8))); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDiffLongNtimesTtooSmall() { System.out.println(Arrays.toString(Diff.values(_dataLong, -1))); }
@Test public void testDiffLongNtimes() { assertTrue(Arrays.equals(_dataLongAnswerDiff0times, Diff.values(_dataLong, 0))); assertTrue(Arrays.equals(_dataLongAnswerDiff1times, Diff.values(_dataLong, 1))); assertTrue(Arrays.equals(_dataLongAnswerDiff2times, Diff.values(_dataLong, 2))); assertTrue(Arrays.equals(_dataLongAnswerDiff3times, Diff.values(_dataLong, 3))); assertTrue(Arrays.equals(_dataLongAnswerDiff4times, Diff.values(_dataLong, 4))); assertTrue(Arrays.equals(_dataLongAnswerDiff5times, Diff.values(_dataLong, 5))); assertTrue(Arrays.equals(_dataLongAnswerDiff6times, Diff.values(_dataLong, 6))); assertTrue(Arrays.equals(_dataLongAnswerDiff7times, Diff.values(_dataLong, 7))); }