@Test
public void iBoundsMin_findsMin() {

    XYSeries s1 = new SimpleXYSeries(
            Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
            Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
            "s1");
    assertEquals(0, SeriesUtils.iBoundsMin(s1, 0, 1));
    assertEquals(6, SeriesUtils.iBoundsMin(s1, 6, 1));
    assertEquals(12, SeriesUtils.iBoundsMin(s1, 12, 1));
    // now test with null vals:
    XYSeries s2 = new SimpleXYSeries(
            Arrays.asList(null, 1, 2, null, null, 5, 6, 7, 8, null, 10, 11, null),
            Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
            "s2");
    assertEquals(0, SeriesUtils.iBoundsMin(s2, 0, 1));
    assertEquals(2, SeriesUtils.iBoundsMin(s2, 3, 1));
    assertEquals(11, SeriesUtils.iBoundsMin(s2, 12, 1));
    // test with a higher step value:
    assertEquals(0, SeriesUtils.iBoundsMin(s2, 0, 5));
    assertEquals(2, SeriesUtils.iBoundsMin(s2, 3, 5));
    assertEquals(11, SeriesUtils.iBoundsMin(s2, 12, 5));
}