### Question:
DeploymentDescriptorUtil { public static Set<Class<?>> getClasses(ClassLoader classLoader, String deploymentDescriptor) { Enumeration<URL> resources; try { resources = classLoader.getResources(deploymentDescriptor); } catch (IOException e) { throw new IllegalStateException("Could not read the deployment descriptor", e); } Set<Class<?>> classes = new HashSet<>(); while (resources.hasMoreElements()) { try (InputStream resourceAsStream = resources.nextElement().openStream(); BufferedReader reader = new BufferedReader( new InputStreamReader(resourceAsStream, StandardCharsets.UTF_8))) { String className; while ((className = reader.readLine()) != null) { if (className.isEmpty() || className.startsWith("#")) { continue; } classes.add(getClass(className, classLoader)); } } catch (IOException e) { throw new IllegalStateException("Could not read the deployment descriptor", e); } } return classes; } private  DeploymentDescriptorUtil(); static Set<Class<?>> getClasses(ClassLoader classLoader, String deploymentDescriptor);  }### Answer:
@Test void testnoNewLineDD() { assertThat(DeploymentDescriptorUtil.getClasses(this.classLoader, "noNewLineDD"), contains(Class1.class)); }
@Test void testwrongClassNameDD() { assertThrows(IllegalArgumentException.class, () -> { DeploymentDescriptorUtil.getClasses(this.classLoader, "wrongClassNameDD"); }); }
@Test void testIOExceptionDD() throws IOException { ClassLoader mock = Mockito.mock(ClassLoader.class); Mockito.when(mock.getResources("normalDD")).thenThrow(IOException.class); assertThrows(IllegalStateException.class, () -> { DeploymentDescriptorUtil.getClasses(mock, "normalDD"); }); }
@Test void testGetClasses() { assertThat(DeploymentDescriptorUtil.getClasses(this.classLoader, "normalDD"), containsInAnyOrder(Class1.class, Class2.class, Class3.class)); }
@Test void testEmptyDeploymentDescriptorGetClasses() { assertThat(DeploymentDescriptorUtil.getClasses(this.classLoader, "emptyDD"), is(empty())); }
@Test void testNoDD() { assertThat(DeploymentDescriptorUtil.getClasses(this.classLoader, "noDD"), is(empty())); }
@Test void testnewLineDD() { assertThat(DeploymentDescriptorUtil.getClasses(this.classLoader, "newLineDD"), contains(Class1.class)); }