private File createTempFile(int numLines) throws Exception {
        File sourceFile = TestUtils.tempFile();

        try (PrintStream printStream = new PrintStream(Files.newOutputStream(sourceFile.toPath()))) {
            for (int i = 0; i < numLines; i++) {
                printStream.printf(LINE_FORMAT + "%n", i);
            }
        }

        return sourceFile;
    }
Create a temporary file and append {@code numLines} to it

@param numLines the number of lines to be appended to the created file
@return the created file
connect/file/src/test/java/org/apache/kafka/connect/file/integration/FileStreamSourceConnectorIntegrationTest.java