public void reference() throws ClosedChannelException {
    int curBits = status.incrementAndGet();
    if ((curBits & STATUS_CLOSED_MASK) != 0) {
      status.decrementAndGet();
      throw new ClosedChannelException();
    }
  }
@Test
  public void testReference() throws ClosedChannelException {
    CloseableReferenceCount clr = new CloseableReferenceCount();
    clr.reference();
    assertEquals("Incorrect reference count", 1, clr.getReferenceCount());
  }