@Test
public void testToArray() {

  final ColorRGBA clr1 = new ColorRGBA(ColorRGBA.DARK_GRAY);
  final float[] farray = clr1.toArray(null);
  final float[] farray2 = clr1.toArray(new float[4]);
  assertNotNull(farray);
  assertNotNull(farray2);
  assertTrue(farray.length == 4);
  assertTrue(farray[0] == .2f);
  assertTrue(farray[1] == .2f);
  assertTrue(farray[2] == .2f);
  assertTrue(farray[3] == 1f);
  try {
    clr1.toArray(new float[1]);
    fail("toFloatArray(d[1]) should have thrown ArrayIndexOutOfBoundsException.");
  } catch (final ArrayIndexOutOfBoundsException e) {}
}