### Question:
ContentFileOperationPerformer { public void addFile(ContentFileTransactionContext context, InputStream inputStream, String path) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(path); File contentDirectory = context.getContentDirectory(); FileUtils.copyInputStreamToFile(inputStream, new File(contentDirectory, path)); context.addAddedFile(path); }  void addFile(ContentFileTransactionContext context, InputStream inputStream, String path); void overwriteFile(ContentFileTransactionContext context, InputStream inputStream, String path, String oldPath);  }### Answer:
@Test(expected = NullPointerException.class) public void addFile_NULL_CONTEXT() throws IOException { contentFileOperationPerformer.addFile(null, is, "file.txt"); }
@Test(expected = NullPointerException.class) public void addFile_NULL_STREAM() throws IOException { contentFileOperationPerformer.addFile(context, null, "file.txt"); }
@Test(expected = NullPointerException.class) public void addFile_NULL_PATH() throws IOException { contentFileOperationPerformer.addFile(context, is, null); }
@Test public void addFile() throws IOException { contentFileOperationPerformer.addFile(context, is, "file.txt"); assertFileInContentDirectory("file.txt", "content of file"); assertEquals(1, context.getAddedFiles().size()); assertEquals("file.txt", context.getAddedFiles().peek()); }