RandomColors extends IndexedColorMapper { public float[] getColorVariance() { return colorVariance; } RandomColors();  RandomColors(long seed); @Override Paint get(int index); float[] getColorVariance(); void setColorVariance(float[] colorVariance);  }
@Test public void testCreation() { RandomColors c = new RandomColors(); float[] expected = new float[] { 0.00f, 1.00f, 0.75f, 0.25f, 0.25f, 0.75f }; float[] actual = c.getColorVariance(); assertEquals(expected.length, actual.length); for (int i = 0; i < actual.length; i++) { assertEquals(expected[i], actual[i], DELTA_FLOAT); } }
@Test public void testSerialization() throws IOException, ClassNotFoundException { QuasiRandomColors original = new QuasiRandomColors(); QuasiRandomColors deserialized = TestUtils.serializeAndDeserialize(original); assertEquals(original.getMode(), deserialized.getMode()); assertArrayEquals(original.getColorVariance(), deserialized.getColorVariance(), DELTA_FLOAT); }