@Test
public void testsetDomainBoundaries() throws Exception {

    plot.addSeries(series0To100, new LineAndPointFormatter());
    plot.calculateMinMaxVals();
    // default to auto so run them
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(9, plot.getBounds().getMaxX().doubleValue(), 0);
    plot.setDomainBoundaries(2, BoundaryMode.FIXED, 8, BoundaryMode.FIXED);
    plot.calculateMinMaxVals();
    // fixed
    assertEquals(2, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(8, plot.getBounds().getMaxX().doubleValue(), 0);
    // back to auto
    plot.setDomainBoundaries(2, BoundaryMode.AUTO, 8, BoundaryMode.AUTO);
    plot.calculateMinMaxVals();
    // run again
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(9, plot.getBounds().getMaxX().doubleValue(), 0);
    
    // we are not testing MinY well with this dataset.
    // try grow
    plot.setDomainBoundaries(2, BoundaryMode.GROW, 8, BoundaryMode.GROW);
    plot.calculateMinMaxVals();
    // run inital
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(9, plot.getBounds().getMaxX().doubleValue(), 0);
    
    // update with more extreme values...
    series0To100.setModel(numList2,SimpleXYSeries.ArrayFormat.Y_VALS_ONLY);
    plot.calculateMinMaxVals();
    // after growing
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(11, plot.getBounds().getMaxX().doubleValue(), 0);
    // back to previous
    series0To100.setModel(numList1,SimpleXYSeries.ArrayFormat.Y_VALS_ONLY);
    plot.calculateMinMaxVals();
    
    // should not of changed.
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(11, plot.getBounds().getMaxX().doubleValue(), 0);
    // back to big
    series0To100.setModel(numList2,SimpleXYSeries.ArrayFormat.Y_VALS_ONLY);
    
    plot.setDomainBoundaries(2, BoundaryMode.SHRINK, 8, BoundaryMode.SHRINK);
    plot.calculateMinMaxVals();
    // run inital
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(11, plot.getBounds().getMaxX().doubleValue(), 0);
    
    // now small
    series0To100.setModel(numList1,SimpleXYSeries.ArrayFormat.Y_VALS_ONLY);
    plot.calculateMinMaxVals();
    // after shrinking
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(9, plot.getBounds().getMaxX().doubleValue(), 0);
    // back to previous
    series0To100.setModel(numList2,SimpleXYSeries.ArrayFormat.Y_VALS_ONLY);
    plot.calculateMinMaxVals();
    
    // should not of changed.
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(9, plot.getBounds().getMaxX().doubleValue(), 0);
    // back to auto
    plot.setDomainBoundaries(2, BoundaryMode.AUTO, 8, BoundaryMode.AUTO);
    plot.calculateMinMaxVals();
    
    // should of changed.
    assertEquals(0, plot.getBounds().getMinX().doubleValue(), 0);
    assertEquals(11, plot.getBounds().getMaxX().doubleValue(), 0);
}