@Test
void testAutoCloseSingleCloseProperty() {

    final AtomicInteger cnt = new AtomicInteger();
    try (S stream = createAutoclosableStream()) {
        stream.onClose(cnt::incrementAndGet);
        stream.close();
    }
    assertEquals(1, cnt.get());
}