### Question:
AbstractLoader { public void loadFromResource(String resource, Candidate.CandidateType type) throws IOException { InputStream candidatesConfig = classloader.getResourceAsStream(resource); if(candidatesConfig == null) { throw new IOException("Resource '" + resource + "' not found"); } try { loadFrom(candidatesConfig, type); } finally { candidatesConfig.close(); } } AbstractLoader(ClassLoader classloader, ErrorHandler errorHandler); void loadFrom(InputStream inputStream, final Candidate.CandidateType type); void loadFromResource(String resource, Candidate.CandidateType type);  }### Answer:
@Test public void testLoadsFromResourceInClassPath() throws IOException { loader.loadFromResource("org/objenesis/tck/CandidateLoaderTest-sample.properties", Candidate.CandidateType.STANDARD); assertEquals("" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$A', 'A candidate')\n" + "registerCandidate('class org.objenesis.tck.AbstractLoaderTest$B', 'B candidate')\n", recordedEvents.toString()); }
@Test public void testThrowsIOExceptionIfResourceNotInClassPath() { try { loader.loadFromResource( "Blatantly-Bogus.properties", Candidate.CandidateType.STANDARD); fail("Expected exception"); } catch(IOException expectedException) { } }