### Question:
WeightWindows { public static DoubleMatrix rect(final DoubleMatrix x) throws IllegalArgumentException { if (!x.isVector()) { System.err.println("myrect: only lying vectors."); throw new IllegalArgumentException(); } return new DoubleMatrix(rect(x.toArray())); }  static DoubleMatrix rect(final DoubleMatrix x); static double[] rect(final double[] x); static double[] hamming(final int n); static double[] hamming(final double[] fr, final double br, final double fs, final double alpha); static DoubleMatrix hamming(final DoubleMatrix fr, final double br, final double fs, final double alpha); static double[] inverseHamming(final double[] hamming); static double[] inverseHamming(final double[] fr, final double br, final double fs, final double alpha); static DoubleMatrix inverseHamming(final DoubleMatrix fr, final double br, final double fs, final double alpha);  }### Answer:
@Test public void testRectArray() throws Exception { double[] rect_ACTUAL = WeightWindows.rect(inputAxisRect); Assert.assertArrayEquals(rect_EXPECTED, rect_ACTUAL, DELTA); }
@Test public void testRectDoubleMatrix() throws Exception { DoubleMatrix rect_ACTUAL = WeightWindows.rect(new DoubleMatrix(inputAxisRect)); Assert.assertEquals(new DoubleMatrix(rect_EXPECTED), rect_ACTUAL); }