### Question:
GenericPackager extends ISOBasePackager implements Configurable { public void readFile(String filename) throws ISOException { try { if (filename.startsWith("jar:") && filename.length()>4) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); readFile( cl.getResourceAsStream(filename.substring(4)) ); } else { createXMLReader().parse(filename); } } catch (Exception e) { throw new ISOException("Error reading " + filename, e); } } GenericPackager();  GenericPackager(String filename);  GenericPackager(InputStream input); void setConfiguration(Configuration cfg); void readFile(String filename); void readFile(InputStream input); @Override void setLogger(Logger logger, String realm); @Override String getDescription();  }### Answer:
@Test public void testReadFileThrowsISOException() throws Throwable { try { new GenericSubFieldPackager().readFile(new ByteArrayInputStream("".getBytes())); fail("Expected ISOException to be thrown"); } catch (ISOException ex) { assertEquals(SAXParseException.class, ex.getNested().getClass(), "ex.getNested().getClass()"); assertEquals("Premature end of file.", ex.getNested().getMessage(), "ex.getNested().getMessage()"); } }
@Test public void testReadFileThrowsISOException1() throws Throwable { try { new GenericPackager().readFile("testGenericPackagerFilename"); fail("Expected ISOException to be thrown"); } catch (ISOException ex) { assertEquals(FileNotFoundException.class, ex.getNested().getClass(), "ex.getNested().getClass()"); } }