### Question:
AbstractLoader { public void loadFrom(InputStream inputStream, final Candidate.CandidateType type) throws IOException { Properties properties = new Properties() { private static final long serialVersionUID = 1L; @Override public Object put(Object key, Object value) { handlePropertyEntry((String) key, (String) value, type); return null; } }; properties.load(inputStream); } AbstractLoader(ClassLoader classloader, ErrorHandler errorHandler); void loadFrom(InputStream inputStream, final Candidate.CandidateType type); void loadFromResource(String resource, Candidate.CandidateType type);  }### Answer:
@Test public void testReadsClassesAndDescriptionsFromPropertiesFile() throws IOException { String input = "" + "org.objenesis.tck.AbstractLoaderTest$A = A candidate\n" + "\n" + "# a comment and some whitespace\n" + "\n" + "org.objenesis.tck.AbstractLoaderTest$B = B candidate\n" + "org.objenesis.tck.AbstractLoaderTest$C = C candidate\n"; loader.loadFrom(new ByteArrayInputStream(input.getBytes()), Candidate.CandidateType.STANDARD); assertEquals("" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$A', 'A candidate')\n" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$B', 'B candidate')\n" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$C', 'C candidate')\n", recordedEvents.toString()); }
@Test public void testReportsMissingClassesToErrorHandler() throws IOException { String input = "" + "org.objenesis.tck.AbstractLoaderTest$A = A candidate\n" + "org.objenesis.tck.AbstractLoaderTest$NonExistent = Dodgy candidate\n" + "org.objenesis.tck.AbstractLoaderTest$C = C candidate\n"; loader.loadFrom(new ByteArrayInputStream(input.getBytes()), Candidate.CandidateType.STANDARD); assertEquals("" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$A', 'A candidate')\n" + "classNotFound('org.objenesis.tck.AbstractLoaderTest$NonExistent')\n" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$C', 'C candidate')\n", recordedEvents.toString()); }