### Question:
ClassLoaderUtil { public static InputStream getResourceAsStream(String resourceName) { URL url = getResource(resourceName); try { if (url != null) { return url.openStream(); } } catch (IOException ignore) { } return null; }  static ClassLoader getContextClassLoader(); static String getClasspath(); static Class<T> loadClass(String className); static Class<T> loadClass(String className, Class<?> referrer); static Class<T> loadClass(String className, ClassLoader classLoader); static Class<T> loadServiceClass(String serviceId); static Class<T> loadServiceClass(String serviceId, Class<?> referrer); static Class<T> loadServiceClass(String serviceId, ClassLoader classLoader); static Class<T> loadServiceClass(String className, String serviceId); static Class<T> loadServiceClass(String className, String serviceId, Class<T> referrer); static Class<T> loadServiceClass(String className, String serviceId, ClassLoader classLoader); static T newInstance(String className); static Object newInstance(String className, Class<?> referrer); static Object newInstance(String className, ClassLoader classLoader); static T newInstance(Class<T> clazz); static T newServiceInstance(String serviceId); static T newServiceInstance(String serviceId, Class<T> referrer); static T newServiceInstance(String serviceId, ClassLoader classLoader); static T newServiceInstance(String className, String serviceId); static T newServiceInstance(String className, String serviceId, Class<T> referrer); static T newServiceInstance(String className, String serviceId, ClassLoader classLoader); static URL[] getResources(String resourceName); static URL[] getResources(String resourceName, Class<?> referrer); static URL[] getResources(String resourceName, ClassLoader classLoader); static URL getResource(String resourceName); static URL getResource(String resourceName, Class<?> referrer); static URL getResource(String resourceName, ClassLoader classLoader); static InputStream getResourceAsStream(String resourceName); static InputStream getResourceAsStream(String resourceName, Class<?> referrer); static InputStream getResourceAsStream(String resourceName, ClassLoader classLoader); static URL[] whichClasses(String className); static URL[] whichClasses(String className, Class<T> referrer); static URL[] whichClasses(String className, ClassLoader classLoader); static URL whichClass(String className); static URL whichClass(String className, Class<T> referrer); static URL whichClass(String className, ClassLoader classLoader);  }### Answer:
@Test public void getResourceAsStream() throws Exception { assertNull(ClassLoaderUtil.getResourceAsStream(null)); assertNotNull(ClassLoaderUtil.getResourceAsStream("META-INF/MANIFEST.MF")); assertNull(ClassLoaderUtil.getResourceAsStream(null, getClass())); assertNull(ClassLoaderUtil.getResourceAsStream(null, (Class<?>) null)); assertNotNull(ClassLoaderUtil.getResourceAsStream("META-INF/MANIFEST.MF", getClass())); assertNotNull(ClassLoaderUtil.getResourceAsStream("META-INF/MANIFEST.MF", (Class<?>) null)); assertNull(ClassLoaderUtil.getResourceAsStream(null, getClass().getClassLoader())); assertNull(ClassLoaderUtil.getResourceAsStream(null, (ClassLoader) null)); assertNotNull(ClassLoaderUtil.getResourceAsStream("META-INF/MANIFEST.MF", getClass().getClassLoader())); assertNotNull(ClassLoaderUtil.getResourceAsStream("META-INF/MANIFEST.MF", (ClassLoader) null)); }