### Question:
FourierTransform { public static double[] getFrequencies(double[] signal, double samplingFrequency) { int size = getPowerOfTwoSize(signal.length); double[] frequencies = new double[size / 2]; for (int i = 0; i < frequencies.length; i++) { frequencies[i] = i * samplingFrequency / size; } return frequencies; } FourierTransform(WindowType windowType, double parameter);  FourierTransform(WindowType windowType);  FourierTransform(); Complex[] forwardFFT(double[] signal); double[] inverseFFT(Complex[] fft); static int getPowerOfTwoSize(int initialSize); static double[] padWithZeroIfNecessary(double[] signal); static double[] getFrequencies(double[] signal, double samplingFrequency); double[] calculatePowerSpectrum(double[] samples);  }### Answer:
@Test public void testGetFrequencies() { double[] signal = new double[8]; double[] expectedFrequencies = new double[] {0, 18.05, 36.1, 54.15}; double[] actualFrequencies = FourierTransform.getFrequencies(signal, 144.4); assertArrayEquals(expectedFrequencies, actualFrequencies, 1e-5); signal = new double[11]; expectedFrequencies = new double[] {0, 9.025, 18.05, 27.075, 36.1, 45.125, 54.15, 63.175}; actualFrequencies = FourierTransform.getFrequencies(signal, 144.4); assertArrayEquals(expectedFrequencies, actualFrequencies, 1e-5); }