### Question:
Results { public void addFile(String filePath) { Validate.notNull(filePath); Validate.notBlank(filePath, "Invalid file/path"); logger.debug("Adding file {}", filePath); List<ErrorResult> list = new ArrayList<ErrorResult>(); results.put(filePath, list); }  void addFile(String filePath); void addResult(String path, int lineNumber, List<String> lines); void clear(); void generate(Formatter formatter, Publisher publisher);  }### Answer:
@Test(expected = NullPointerException.class) public void testAddFile_fail_when_path_is_null() { instance.addFile(null); }
@Test(expected = IllegalArgumentException.class) public void testAddFile_fail_when_path_is_empty() { instance.addFile(""); }
@Test public void testAddFile_fail_when_path_okay_2() { final String path = "/use/local/myfile.log"; instance.addFile(path); @SuppressWarnings("unchecked") Map<String, List<Results.ErrorResult>> results = (Map<String, List<ErrorResult>>) ReflectionTestUtils .getField(instance, "results"); assertEquals(1, results.size()); List<Results.ErrorResult> result = results.get(path); assertTrue(result.isEmpty()); }