Box extends Dimension { boolean fitRotate2D(int w, int d) { if (w >= width && d >= depth) { return true; } if (d >= width && w >= depth) { rotate2D(); return true; } return false; } Box(int w, int d, int h, int weight);  Box(String name, int w, int d, int h, int weight);  Box(final Dimension dimension, final Integer weight); Box rotate3D(); Box clone(); Box rotate2D(); Box rotate2D3D(); int getWeight(); @Override String toString();  }
@Test void testFitInFootprintRotate() { Box box = new Box(1, 6, 3, 0); Assert.assertTrue(box.fitRotate2D(1, 6)); assertThat(box.getWidth(), is(1)); assertThat(box.getDepth(), is(6)); Assert.assertTrue(box.fitRotate2D(6, 1)); assertThat(box.getWidth(), is(6)); assertThat(box.getDepth(), is(1)); Assert.assertFalse(box.fitRotate2D(1, 3)); Assert.assertFalse(box.fitRotate2D(3, 1)); }