### Question:
FileManager { Path copyToTemp() throws IOException { final Path buildahTempDirectory = Files.createTempDirectory("buildah"); return copyToLocation(buildahTempDirectory); } FileManager(String name, InputStream content);   }### Answer:
@Test public void should_copy_file_from_inputstream_to_temp_file() throws IOException { final InputStream resourceAsStream = new ByteArrayInputStream("Hello Buildah".getBytes()); final FileManager fileManager = new FileManager("hello.txt", resourceAsStream); final Path copyToTemp = fileManager.copyToTemp(); assertThat(copyToTemp) .exists() .hasContent("Hello Buildah"); }