### Question:
ARGB { public static float[] toHSVA(int argb) { float[] hsva = new float[4]; float b = ARGB.getB(argb); float g = ARGB.getG(argb); float r = ARGB.getR(argb); hsva[3] = ARGB.getA(argb); hsva[2] = Math.max(r, Math.max(g, b)); float Cmin = Math.min(r, Math.min(g, b)); float Cdelt = hsva[2] - Cmin; hsva[1] = (hsva[2] == 0) ? 0 : Cdelt / hsva[2]; hsva[0] = 60f; if (Cdelt == 0) { hsva[0] = 0; } else if (hsva[2] == r) { hsva[0] *= ((g-b)/Cdelt) % 6f; } else if (hsva[2] == g) { hsva[0] *= ((b-r)/Cdelt) + 2f; } else { hsva[0] *= ((r-g)/Cdelt) + 4f; } return hsva; }  static float getA(int argb); static int rawA(int argb); static float getR(int argb); static int rawR(int argb); static float getG(int argb); static int rawG(int argb); static float getB(int argb); static int rawB(int argb); static int toARGB(float a, float r, float g, float b); static int toARGB(int a, int r, int g, int b); static float[] toHSVA(int argb);  }### Answer:
@Test public void testToHSVA() throws Exception { Assert.assertEquals(0, ARGB.toHSVA(ARGB.toARGB(1f, 1f, 0f, 0f))[0], 0.1); Assert.assertEquals(120, ARGB.toHSVA(ARGB.toARGB(1f, 0f, 1f, 0f))[0], 0.1); Assert.assertEquals(240, ARGB.toHSVA(ARGB.toARGB(1f, 0f, 0f, 1f))[0], 0.1); }