public void write(byte[] b, int off, int len) throws IOException {
        requireOpened();
        if (len > 0) {
            stream.write(b, off, len);
        }
    }
@Test
    void writeAfterCloseShouldThrowException() {
        assertThatExceptionOfType(IOException.class)
                .isThrownBy(
                        () -> {
                            final RefCountedFileWithStream fileUnderTest =
                                    getClosedRefCountedFileWithContent(
                                            "hello world",
                                            TempDirUtils.newFolder(tempFolder).toPath());
                            byte[] content = bytesOf("Hello Again");
                            fileUnderTest.write(content, 0, content.length);
                        });
    }