@Test
    public void testColorPointSerialization() {

        MyColorPoint cp1 = new MyColorPoint(new MyPoint(1,2), new MyColor(1.1f, 1.2));

        // Serialize
        System.out.println("Serializing MyColorPoint...");
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream out = null;
        try {
            out = new ObjectOutputStream(bos);
            out.writeObject(cp1);
        } catch (IOException e) {

            Assert.fail("Serialization for MyColorPoint failed : ", e);
        } finally {
            try {
                if (out != null) out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        // De serialize
        System.out.println("Deerializing MyColorPoint...");
        ObjectInputStream in = null;
        MyColorPoint cp2 = null;
        try {
            in = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));
            cp2 = (MyColorPoint)in.readObject();
            in.close();
        } catch (IOException e) {

            Assert.fail("De serialization for MyColorPoint failed : ", e);
        } catch (ClassNotFoundException e) {

            Assert.fail("De serialization for MyColorPoint failed : ", e);
        } finally {
            try {
                if (in != null) in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        Assert.assertTrue(cp1.equals(cp2));

    }