@Override
    public double[] smooth(double[] input) {

        if (input.length < weights.length) {
            return input;
        }

        double[] smoothed = new double[input.length];
        int halfWindowFloored = weights.length / 2; // we want to exclude the center point

        fillSmoothedLeftSide(smoothed, input, halfWindowFloored);
        fillSmoothedRightSide(smoothed, input, halfWindowFloored);

        for (int i = halfWindowFloored; i < input.length - halfWindowFloored; i++) {
            for (int windowIndex = 0; windowIndex < smoothCoeff.length; windowIndex++) {
                smoothed[i] += smoothCoeff[windowIndex] * input[i + windowIndex + offsetFromWindowCenter];
            }
        }
        return smoothed;
    }
@Test
    public void Smooth_FromEmptyTrack_ReturnEmptyTrack() {

        SavitzkyGolayFilter test = new SavitzkyGolayFilter(1.0);
        double[] actual = test.smooth(new double[0]);

        assertThat(actual.length, equalTo(0));
    }