### Question:
InternalUtilities extends Static { @SuppressWarnings("fallthrough") public static int parseColor(String color) throws NumberFormatException { color = color.trim(); if (color.startsWith("#")) { final String code = color.substring(1); int value = (int) Long.parseLong(code, 16); switch (code.length()) { case 3: value |= 0xF000; case 4: { int t; return (((t=(value & 0xF000)) | (t << 4)) << 12) | (((t=(value & 0x0F00)) | (t << 4)) << 8) | (((t=(value & 0x00F0)) | (t << 4)) << 4) | (((t=(value & 0x000F)) | (t << 4))); } case 6: value |= 0xFF000000; case 8: return value; } } else { final long n = Long.decode(color); int value = (int) n; if (value == n) { if ((value & 0xFF000000) == 0) { value |= 0xFF000000; } return value; } } throw new NumberFormatException(Errors.format( Errors.Keys.IllegalArgument_2, "color", color)); } private  InternalUtilities(); static boolean epsilonEqual(final double v1, final double v2, final ComparisonMode mode); static boolean epsilonEqual(final double v1, final double v2); static boolean debugEquals(final Object o1, final Object o2); static double adjustForRoundingError(final double value, double scale, final int maxULP); static double adjustForRoundingError(final double value); static void configure(final NumberFormat format, double value, final int maxPrecision); @SuppressWarnings("fallthrough") static int parseColor(String color); static final double COMPARISON_THRESHOLD; static final double LINEAR_TOLERANCE; static final double ANGULAR_TOLERANCE; }### Answer:
@Test public void testParseColor() { assertEquals("#23456789", 0x23456789, parseColor("#23456789")); assertEquals("#456789", 0xFF456789, parseColor("#456789")); assertEquals("#A0BC", 0xAA00BBCC, parseColor("#A0BC")); assertEquals("#0BC", 0xFF00BBCC, parseColor("#0BC")); assertEquals("#D2787034", 0xD2787034, parseColor("#D2787034")); try { parseColor("#1D2787034"); fail("Should not accept values greater than 32 bits."); } catch (NumberFormatException e) { assertTrue(e.getMessage().contains("#1D2787034")); } }