public boolean unreference() {
    int newVal = status.decrementAndGet();
    Preconditions.checkState(newVal != 0xffffffff,
        "called unreference when the reference count was already at 0.");
    return newVal == STATUS_CLOSED_MASK;
  }
@Test
  public void testUnreference() throws ClosedChannelException {
    CloseableReferenceCount clr = new CloseableReferenceCount();
    clr.reference();
    clr.reference();
    assertFalse("New reference count should not equal STATUS_CLOSED_MASK",
        clr.unreference());
    assertEquals("Incorrect reference count", 1, clr.getReferenceCount());
  }