public void testSerialization() {

        PieLabelRecord p1 = new PieLabelRecord("A", 1.0, 2.0, new TextBox("B"), 
                3.0, 4.0, 5.0);
        PieLabelRecord p2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(p1);
            out.close();

            ObjectInput in = new ObjectInputStream(
                    new ByteArrayInputStream(buffer.toByteArray()));
            p2 = (PieLabelRecord) in.readObject();
            in.close();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        boolean b = p1.equals(p2);
        assertTrue(b);