ResourceHelper { static String[] getClassPathElements() { return System.getProperty("java.class.path", ".").split(System.getProperty("path.separator")); } private  ResourceHelper(); static Stream<String> getResourcesByExtension(String extension); static Stream<String> getResourcesFromDirectory(File directory, Pattern pattern);  }
@Test public void getClassPathElementsTest() { List<String> classPathElements = Arrays.asList(getClassPathElements()); List<String> notJar = classPathElements.stream().filter(elem -> !elem.contains(".jar")).collect(Collectors.toList()); assertTrue(notJar.stream().anyMatch(elem -> elem.contains("test-classes"))); }