@Test
public void testGetOverlappingIntervals() {

    IntervalIntegerMap i = new IntervalIntegerMap();
    i.put(new Interval(2001, 2004), 42);
    Assert.assertEquals(i.getOverlappingIntervals(2001, 2004), new int[] { 0 });
    Assert.assertEquals(i.getOverlappingIntervals(2001, 2005), new int[] { 0 });
    Assert.assertEquals(i.getOverlappingIntervals(2001, Double.POSITIVE_INFINITY), new int[] { 0 });
    IntervalIntegerMap j = new IntervalIntegerMap();
    j.put(new Interval(2000, 2002), 42);
    j.put(new Interval(2002, 2002), 42);
    j.put(new Interval(2002, 2004), 42);
    j.put(new Interval(2005, 2006), 42);
    Assert.assertEquals(j.getOverlappingIntervals(1998, 1999), new int[] {});
    Assert.assertEquals(j.getOverlappingIntervals(1998, 2001), new int[] { 0 });
    Assert.assertEquals(j.getOverlappingIntervals(1998, 2000), new int[] { 0 });
    Assert.assertEquals(j.getOverlappingIntervals(1998, 2002), new int[] { 0, 1, 2 });
    Assert.assertEquals(j.getOverlappingIntervals(2000, 2001), new int[] { 0 });
    Assert.assertEquals(j.getOverlappingIntervals(2001, 2001), new int[] { 0 });
    Assert.assertEquals(j.getOverlappingIntervals(2003, 2003), new int[] { 2 });
    Assert.assertEquals(j.getOverlappingIntervals(2003, 2007), new int[] { 2, 3 });
    Assert.assertEquals(j.getOverlappingIntervals(2009, 2010), new int[] {});
    Assert.assertEquals(j.getOverlappingIntervals(2002, 2004.9), new int[] { 1, 2 });
}