@Test
public void testClamp() {

  final ColorRGBA clr1 = new ColorRGBA(-1, -1, -1, -1);
  final ColorRGBA clr2 = clr1.clamp(new ColorRGBA());
  final ColorRGBA clr3 = clr1.clamp(null);
  assertNotNull(clr2);
  assertNotNull(clr3);
  assertTrue(clr2.getRed() == 0);
  assertTrue(clr2.getGreen() == 0);
  assertTrue(clr2.getBlue() == 0);
  assertTrue(clr2.getAlpha() == 0);
  clr1.set(2, .5f, 1, 0);
  clr1.clamp(clr2);
  assertTrue(clr2.getRed() == 1);
  assertTrue(clr2.getGreen() == .5f);
  assertTrue(clr2.getBlue() == 1);
  assertTrue(clr2.getAlpha() == 0);
  clr1.set(2, 2, 2, 2);
  clr1.clampLocal();
  assertTrue(clr1.getRed() == 1);
  assertTrue(clr1.getGreen() == 1);
  assertTrue(clr1.getBlue() == 1);
  assertTrue(clr1.getAlpha() == 1);
  clr1.set(0.5f, 0.5f, 0.5f, 0.5f);
  assertEquals(clr1, clr1.clamp(null));
}