### Question:
Foo { public void write(final Path path, final List<String> list) { try { Files.write(path, list); } catch (final IOException e) { e.printStackTrace(); } }  void write(final Path path, final List<String> list);  }### Answer:
@Test public void test01() throws IOException { final Path path = Files.createTempFile("kgp-", Long.toString(System.nanoTime())); final List<String> contents = Arrays.asList(Double.toString(Math.random())); new Foo().write(path, contents); final List<String> actualContents = Files.readAllLines(path); assertEquals(actualContents, contents); }