Bounds implements IRenderingElement { public final double width() { return maxX - minX; } Bounds(double x1, double y1, double x2, double y2);  Bounds();  Bounds(IRenderingElement element); void add(IRenderingElement element); void add(double x, double y); void add(Bounds bounds); IRenderingElement root(); final double width(); final double height(); final boolean isEmpty(); @Override void accept(IRenderingVisitor visitor); @Override String toString(); public double minX; public double maxX; }
@Test public void width() throws Exception { assertThat(new Bounds(2, 2, 7, 6).width(), is(closeTo(5d, 0.1))); }