Dodecahedron { public String toString() { DecimalFormat fmt = new DecimalFormat("#,##0.0##"); return "Dodecahedron \"" + label + "\" is \"" + color + "\" with 30 edges of length " + edge + " units.\n\t" + "surface area = " + fmt.format(surfaceArea()) + " square units\n\t" + "volume = " + fmt.format(volume()) + " cubic units\n\t" + "surface/volume ratio = " + fmt.format(surfaceToVolumeRatio()); } Dodecahedron(String labelIn, String colorIn, double edgeIn); String getLabel(); boolean setLabel(String labelIn); String getColor(); boolean setColor(String colorIn); double getEdge(); boolean setEdge(double edgeIn); double surfaceArea(); double volume(); double surfaceToVolumeRatio(); String toString(); static void resetCount(); boolean equals(Object obj); int hashCode();  }
@Test public void toStringTest() { Dodecahedron[] dodObjList = new Dodecahedron[10]; for (int i = 0; i < 5; i++) { Dodecahedron dodObj = new Dodecahedron("test" + i, "color" + i, i + .25); dodObjList[i] = dodObj; } Assert.assertEquals("", true, dodObjList[4].toString().contains("4.25")); }