public void testExtendEnd() {
double[] data = {1, 2, 3, 4};
Filter filter = new Filter(new double[]{2, 8, 4, -1});
double[] result = new Extensioner(data)
.schedule(new CyclicEndExtension(filter.getLength()))
.execute();
double[] expected = {1, 2, 3, 4, 1, 2, 3, 4};
assertEquals(expected.length, result.length);
assertArrayEquals(expected, result, 0);
data = new double[]{1, 2, 3};
result = new Extensioner(data)
.schedule(new ZeroPaddingToEven())
.schedule(new CyclicEndExtension(filter.getLength()))
.execute();
expected = new double[]{1, 2, 3, 0, 1, 2, 3, 0};
assertEquals(expected.length, result.length);
assertArrayEquals(expected, result, 0);
}