void flush() throws IOException {
        requireOpened();
        stream.flush();
    }
@Test
    void flushAfterCloseShouldThrowException() {
        assertThatExceptionOfType(IOException.class)
                .isThrownBy(
                        () -> {
                            final RefCountedFileWithStream fileUnderTest =
                                    getClosedRefCountedFileWithContent(
                                            "hello world",
                                            TempDirUtils.newFolder(tempFolder).toPath());
                            fileUnderTest.flush();
                        });
    }