/** BoxTester.java tests the methods of Box.java. * in the face of possible roundoff errors. * Compile normally, run with assert enabled: * java -ea BoxTester */ public class BoxTester { public static void main(String[] args) { new BoxTester().testVolume(); // add tests for other Box methods here } public void testVolume() { System.out.print("Testing Box.volume(): "); Box aBox = new Box(2.0, 3.0, 4.0); // test 1 double vol = aBox.volume(); assert vol == 24.0; System.out.print(" 1 "); aBox = new Box(6.0, 5.0, 4.0); // test 2 vol = aBox.volume(); assert vol == 120.0; System.out.print(" 2 "); System.out.println(" Passed!"); } }