### Question:
Colors { @Nonnull public static String encodeToHexRGB(@Nonnull Color color) { requireNonNull(color, "color"); return String.format("#%06X", color.getRGB() & 0x00FFFFFF); } private  Colors(); @Nonnull static String encodeToHexRGB(@Nonnull Color color); @Nonnull static Color decodeFromHexRGB(@Nonnull String rgbHex);  }### Answer:
@Test public void testEncodeToHexRGB() { assertEquals("#000000", Colors.encodeToHexRGB(new Color(0, 0, 0))); assertEquals("#FFFFFF", Colors.encodeToHexRGB(new Color(255, 255, 255))); assertEquals("#FF0000", Colors.encodeToHexRGB(new Color(255, 0, 0))); assertEquals("#00FF00", Colors.encodeToHexRGB(new Color(0, 255, 0))); assertEquals("#0000FF", Colors.encodeToHexRGB(new Color(0, 0, 255))); assertEquals("#000001", Colors.encodeToHexRGB(new Color(0, 0, 1))); assertEquals("#000100", Colors.encodeToHexRGB(new Color(0, 1, 0))); assertEquals("#010000", Colors.encodeToHexRGB(new Color(1, 0, 0))); }