### Question:
StringUtils { @Nonnull @MustNotContainNull public static List<String> extractJdepsModuleNames(@Nonnull final String text) { final List<String> result = new ArrayList<>(); for (final String line : text.split("\\n")) { final Matcher lineMatcher = PATTERN_MODULE_LINE.matcher(line); if (lineMatcher.find()) { final String moduleName = lineMatcher.group(2).trim(); if (!moduleName.contains(" ")) { result.add(moduleName); } } } return result; } private  StringUtils(); @Nonnull static String escapeFileName(@Nonnull final String text); @Nonnull static String extractFileHash(@Nonnull final String text); static int printTextProgress(@Nonnull final String text, final long value, final long maxValue, final int progressBarWidth, final int lastValue); @Nonnull @MustNotContainNull static List<String> extractJdepsModuleNames(@Nonnull final String text);  }### Answer:
@Test public void testExtractModuleNames() throws Exception { final String text = IOUtils.resourceToString("jmods.out", StandardCharsets.UTF_8, StringUtilsTest.class.getClassLoader()); final List<String> modules = StringUtils.extractJdepsModuleNames(text); assertArrayEquals( new String[] { "java.base", "java.compiler", "java.datatransfer", "java.desktop", "java.logging", "java.naming", "java.prefs", "java.scripting", "java.sql", "jdk.unsupported" }, modules.toArray()); }