@Test
  public void testGetSetUserBits() throws Exception {
    DiskId did = getDiskId();
    byte userBits = 0;
    userBits = EntryBits.setSerialized(userBits, true);
    did.setUserBits(userBits);
    assertEquals(userBits, did.getUserBits());
    userBits = EntryBits.setInvalid(userBits, true);
    did.setUserBits(userBits);
    assertEquals(userBits, did.getUserBits());
    userBits = EntryBits.setLocalInvalid(userBits, true);
    did.setUserBits(userBits);
    assertEquals(userBits, did.getUserBits());
    assertTrue(EntryBits.isSerialized(userBits));
    assertTrue(EntryBits.isInvalid(userBits));
    assertTrue(EntryBits.isLocalInvalid(userBits));
    userBits = EntryBits.setSerialized(userBits, false);
    did.setUserBits(userBits);
    assertEquals(userBits, did.getUserBits());
    userBits = EntryBits.setInvalid(userBits, false);
    did.setUserBits(userBits);
    assertEquals(userBits, did.getUserBits());
    userBits = EntryBits.setLocalInvalid(userBits, false);
    did.setUserBits(userBits);
    assertFalse(EntryBits.isSerialized(userBits));
    assertFalse(EntryBits.isInvalid(userBits));
    assertFalse(EntryBits.isLocalInvalid(userBits));

    userBits = 0x0;
    userBits = EntryBits.setSerialized(userBits, true);
    did.setUserBits(userBits);
    assertTrue(EntryBits.isSerialized(userBits));
    assertFalse(EntryBits.isInvalid(userBits));
    assertFalse(EntryBits.isLocalInvalid(userBits));

    userBits = 0x0;
    userBits = EntryBits.setInvalid(userBits, true);
    did.setUserBits(userBits);
    assertFalse(EntryBits.isSerialized(userBits));
    assertTrue(EntryBits.isInvalid(userBits));
    assertFalse(EntryBits.isLocalInvalid(userBits));

    userBits = 0x0;
    userBits = EntryBits.setLocalInvalid(userBits, true);
    did.setUserBits(userBits);
    assertFalse(EntryBits.isSerialized(userBits));
    assertFalse(EntryBits.isInvalid(userBits));
    assertTrue(EntryBits.isLocalInvalid(userBits));

    userBits = 0x0;
    userBits = EntryBits.setTombstone(userBits, true);
    userBits = EntryBits.setWithVersions(userBits, true);
    did.setUserBits(userBits);
    assertFalse(EntryBits.isLocalInvalid(userBits));
    assertFalse(EntryBits.isSerialized(userBits));
    assertFalse(EntryBits.isInvalid(userBits));
    assertTrue(EntryBits.isTombstone(userBits));
    assertTrue(EntryBits.isWithVersions(userBits));
  }
Test the getUserbits returns what has been set
geode-core/src/test/java/org/apache/geode/internal/cache/DiskIdJUnitTest.java