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