### Question:
ColorUtilities { public static Color brighten(Color input, double factor) { if (factor < BRIGHTNESS_FACTOR_MIN || factor > BRIGHTNESS_FACTOR_MAX) { throw new IllegalArgumentException("Color brighten factor must be between 0.01 and 0.99"); } int r = input.getRed(); int g = input.getGreen(); int b = input.getBlue(); int i = (int)(BLACK_BRIGHTEN_MIN / (1.0 - factor)); if (r == 0 && g == 0 && b == 0) { return new Color(i, i, i); } if (r > 0 && r < i) { r = i; } if (g > 0 && g < i) { g = i; } if (b > 0 && b < i) { b = i; } return new Color(Math.min((int)(r / factor), 255), Math.min((int)(g / factor), 255), Math.min((int)(b / factor), 255), input.getAlpha()); } private  ColorUtilities(); static Color blendColors(Color color1, Color color2); static Color brighten(Color input, double factor); static Color convertFromColorString(String color); static Color convertFromHexString(String color, int redIndex, int greenIndex, int blueIndex); static Color convertFromHexString(String color, int redIndex, int greenIndex, int blueIndex, int alphaIndex); static String convertToHexString(Color color, int redIndex, int greenIndex, int blueIndex); static String convertToHexString(Color color, int redIndex, int greenIndex, int blueIndex, int alphaIndex); static String convertToRGBAColorString(Color aColor); static Color darken(Color input, double factor); static Color lighten(Color color); static int getBrightness(Color color); static Color getContrastingColor(Color color); static Color getAlternateColor(Color color, int shift); static boolean isEqual(Color c1, Color c2); static boolean isEqualIgnoreAlpha(Color c1, Color c2); static Color opacitizeColor(Color startingColor, float alpha); static Color opacitizeColor(Color startingColor, int alpha); static final int COLOR_COMPONENT_MAX_VALUE; }### Answer:
@Test public void testBrighten() { Color color1 = new Color(40, 40, 40); Assert.assertEquals(color1.brighter(), ColorUtilities.brighten(color1, .7)); Color color2 = new Color(40, 40, 40, 10); Assert.assertEquals(ColorUtilities.opacitizeColor(color2.brighter(), 10), ColorUtilities.brighten(color2, .7)); }