@Test
public void testLevelToJitter() throws Exception {

    Number val = new NumberWithJitter<Integer>(15, 1, 2);
    Number n = new NumberWithGradient(3, val, 2);
    int expected[] = { 3, 5, 7, 9, 11, 13 };
    for(int idx=0; idx<expected.length; idx++) {
        int i = n.intValue();
        Assert.assertEquals("Step 1: Invalid value at iteration " + idx, expected[idx], i);
    }
    for(int idx=0; idx<10; idx++) {
        int i = n.intValue();
        Assert.assertTrue("Step 2: Invalid value at iteration " + idx, Math.abs(i - 15) <= 2);
    }
}