### Question:
SpectralUtils { public static void fftshift_inplace(ComplexDoubleMatrix inMatrix) { inMatrix.copy(fftshift(inMatrix)); }  static void fft1D_inplace(ComplexDoubleMatrix vector, final int fftLength); static void invfft1D_inplace(ComplexDoubleMatrix vector, final int fftLength); static ComplexDoubleMatrix fft1D(ComplexDoubleMatrix vector, final int fftLength); static ComplexDoubleMatrix invfft1D(ComplexDoubleMatrix vector, final int fftLength); static ComplexDoubleMatrix fft(ComplexDoubleMatrix inMatrix, final int dimension); static ComplexDoubleMatrix invfft(ComplexDoubleMatrix inMatrix, final int dimension); static void fft_inplace(ComplexDoubleMatrix inMatrix, int dimension); static void invfft_inplace(ComplexDoubleMatrix inMatrix, int dimension); static void fft2D_inplace(ComplexDoubleMatrix A); static ComplexDoubleMatrix fft2D(ComplexDoubleMatrix inMatrix); static void fft2D_inplace(DoubleMatrix A); static void invfft2D_inplace(ComplexDoubleMatrix A); static ComplexDoubleMatrix invfft2d(ComplexDoubleMatrix inMatrix); static ComplexDoubleMatrix fftshift(ComplexDoubleMatrix inMatrix); static DoubleMatrix fftshift(DoubleMatrix inMatrix); static void fftshift_inplace(ComplexDoubleMatrix inMatrix); static void fftshift_inplace(DoubleMatrix inMatrix); static ComplexDoubleMatrix ifftshift(ComplexDoubleMatrix inMatrix); static DoubleMatrix ifftshift(DoubleMatrix inMatrix); static void ifftshift_inplace(ComplexDoubleMatrix inMatrix); static void ifftshift_inplace(DoubleMatrix inMatrix);  }### Answer:
@Test public void testFftshiftDouble_inplace() throws Exception { double[] vectorTemp_EXPECTED = vector_EXPECTED.clone(); DoubleMatrix shiftMatrixDouble_EXPECTED = new DoubleMatrix(shiftVector_EXPECTED); DoubleMatrix shiftMatrixDouble_ACTUAL = new DoubleMatrix(vectorTemp_EXPECTED); SpectralUtils.fftshift_inplace(shiftMatrixDouble_ACTUAL); Assert.assertEquals(shiftMatrixDouble_EXPECTED, shiftMatrixDouble_ACTUAL); }
@Test public void testFftshiftComplex_inplace() throws Exception { double[] vectorTemp_EXPECTED = vector_EXPECTED.clone(); ComplexDoubleMatrix shiftMatrixCplx_EXPECTED = new ComplexDoubleMatrix(new DoubleMatrix(shiftVector_EXPECTED), new DoubleMatrix(shiftVector_EXPECTED)); ComplexDoubleMatrix shiftMatrixCplx_ACTUAL = new ComplexDoubleMatrix(new DoubleMatrix(vectorTemp_EXPECTED), new DoubleMatrix(vectorTemp_EXPECTED)); SpectralUtils.fftshift_inplace(shiftMatrixCplx_ACTUAL); Assert.assertEquals(shiftMatrixCplx_EXPECTED, shiftMatrixCplx_ACTUAL); }