@Override
    public boolean equals(Object other) {
        if (!(other instanceof CodeBuffer)) {
            return false;
        }
        CodeBuffer o = (CodeBuffer) other;
        return lines.equals(o.lines);
    }
@Test
    public void testEquals() {
        CodeBuffer buffer1 = new CodeBuffer();
        CodeBuffer buffer2 = new CodeBuffer();
        assertEquals(buffer1, buffer2);
        buffer1.printf("hello world");
        assertNotEquals(buffer1, buffer2);
        buffer2.printf("hello world");
        assertEquals(buffer1, buffer2);
        buffer1.printf("foo, bar, and baz");
        buffer2.printf("foo, bar, and baz");
        assertEquals(buffer1, buffer2);
    }