### Question:
SslKeyStore { public static InputStream asInputStream(String filename, PathType pathType) { InputStream in; switch (pathType) { case CLASSPATH: in = SslKeyStore.class.getResourceAsStream(filename); if (in == null) { throw new IllegalStateException("KeyStore file not found: " + filename); } break; case PATH: LOG.debug("Current dir using System:" + System.getProperty("user.dir")); File keystorefile = new File(filename); try { in = new FileInputStream(keystorefile); } catch (FileNotFoundException e) { throw new IllegalStateException("KeyStore file not found: " + filename,e); } break; default: throw new IllegalArgumentException("Unknown path type: " + pathType); } return in; } private  SslKeyStore(); static InputStream asInputStream(String filename, PathType pathType);  }### Answer:
@Test public void testAsInputStream() throws Exception { InputStream inputStream = SslKeyStore.asInputStream("/key.bin", PathType.CLASSPATH); assertNotNull( inputStream ); inputStream.close(); }
@Test public void testAsInputStream2() throws Exception { InputStream inputStream = SslKeyStore.asInputStream("src/test/resources/key.bin", PathType.PATH); assertNotNull( inputStream ); inputStream.close(); }