@Test
public void getNullRegion_producesExpectedResult() {

    XYSeries s1 = new SimpleXYSeries(
            SimpleXYSeries.ArrayFormat.XY_VALS_INTERLEAVED, "s1",
            0, 0, // 0
            1, 1,         // 1
            2, 2,         // 2
            null, null,   // 3
            null, null,   // 4
            5, 5,         // 5
            6, 6);        // 6
    try {
        Region r1 = SeriesUtils.getNullRegion(s1, 0);
        fail("IllegalArgumentException expected.");
    } catch(IllegalArgumentException e) {
        // expected
    }
    try {
        Region r2 = SeriesUtils.getNullRegion(s1, s1.size() - 1);
        fail("IllegalArgumentException expected.");
    } catch(IllegalArgumentException e) {
        // expected
    }
    Region r3 = SeriesUtils.getNullRegion(s1, 3);
    assertEquals(2, r3.getMin().intValue());
    assertEquals(5, r3.getMax().intValue());
    Region r4 = SeriesUtils.getNullRegion(s1, 4);
    assertEquals(2, r4.getMin().intValue());
    assertEquals(5, r4.getMax().intValue());
}