double[] appleLimits = { 1, 2, 3, 4, 5 };
String[] appleFormats = { "Tiny Apple", "Small Apple", "Medium Apple",
"Large Apple", "Huge Apple" };
ChoiceFormat cf = new ChoiceFormat(appleLimits, appleFormats);
formattedString = cf.format(Double.NEGATIVE_INFINITY);
assertTrue("a) Incorrect format returned: " + formattedString,
formattedString.equals("Tiny Apple"));
formattedString = cf.format(0.5d);
assertTrue("b) Incorrect format returned: " + formattedString,
formattedString.equals("Tiny Apple"));