public void testSerialization() {

        CategoryMarker m1 = new CategoryMarker("A", new GradientPaint(1.0f, 
                2.0f, Color.white, 3.0f, 4.0f, Color.yellow), 
                new BasicStroke(1.1f));
        CategoryMarker m2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
            out.close();

            ObjectInput in = new ObjectInputStream(
                    new ByteArrayInputStream(buffer.toByteArray()));
            m2 = (CategoryMarker) in.readObject();
            in.close();
        }
        catch (Exception e) {
            fail(e.toString());
        }
        boolean b = m1.equals(m2);
        assertTrue(b);