InfoCmp { public static String getLoadedInfoCmp(String terminal) { Object caps = CAPS.get(terminal); if (caps instanceof Supplier) { caps = ((Supplier) caps).get(); } return (String) caps; } private  InfoCmp(); static Map<String, Capability> getCapabilitiesByName(); static void setDefaultInfoCmp(String terminal, String caps); static void setDefaultInfoCmp(String terminal, Supplier<String> caps); static String getInfoCmp(
            String terminal
    ); static String getLoadedInfoCmp(String terminal); static void parseInfoCmp(
            String capabilities,
            Set<Capability> bools,
            Map<Capability, Integer> ints,
            Map<Capability, String> strings
    );  }
@Test public void testAllCapsFile() throws IOException { String packagePath = InfoCmp.class.getPackage().getName().replace(".", "/"); ArrayList<URL> packageLocations = Collections.list(Thread.currentThread().getContextClassLoader().getResources(packagePath)); List<String> allCaps = packageLocations.stream().map(url -> { try { Path capsLocation = Paths.get(url.toURI()); PathMatcher pathMatcher = FileSystems.getDefault().getPathMatcher("glob:**.caps"); List<String> s = Files.walk(capsLocation) .filter(pathMatcher::matches) .map(Path::getFileName) .map(Path::toString) .map(fileName -> fileName.split("\\.")[0]) .collect(Collectors.toList()); return s.stream(); } catch (URISyntaxException | IOException e) { throw new RuntimeException(e); } }).flatMap(Function.identity()) .collect(Collectors.toList()); allCaps.forEach( (capsName) -> assertNotNull(String.format("%s.caps was not registered in InfoCmp class", capsName), InfoCmp.getLoadedInfoCmp(capsName)) ); }