@Test
public void testCompressIncreasingFunction() {

    StepFunction<TestImpurityMeasure> function = new StepFunction<>(
        new double[]{1, 2, 3, 4, 5},
        TestImpurityMeasure.asTestImpurityMeasures(1, 2, 3, 4, 5)
    );
    SimpleStepFunctionCompressor<TestImpurityMeasure> compressor = new SimpleStepFunctionCompressor<>(1, 0.4, 0);
    StepFunction<TestImpurityMeasure> resFunction = compressor.compress(function);
    assertArrayEquals(new double[]{1, 3, 5}, resFunction.getX(), 1e-10);
    assertArrayEquals(TestImpurityMeasure.asTestImpurityMeasures(1, 3, 5), resFunction.getY());
}