@Override
    public Bitmap clone()
    {
        return Bitmap.fromBytes(length, bitSet.toByteArray());
    }
@Test
    public static void testClone()
    {
        Bitmap bitmapA = Bitmap.fromBytes(100 * 8, BYTE_STRING_A);
        Bitmap bitmapB = bitmapA.clone();

        // all bits should match
        for (int i = 0; i < 100 * 8; i++) {
            assertEquals(bitmapA.getBit(i), bitmapB.getBit(i));
        }

        // but the bitmaps should point to different bits
        bitmapA.flipBit(0);
        assertEquals(bitmapA.getBit(0), !bitmapB.getBit(0));
    }