@Test
public void getResourcesFromDirectoryTest() {

    List<String> classPathElements = Arrays.asList(getClassPathElements());
    Optional<String> testFolder = classPathElements.stream().filter(elem -> elem.contains("test-classes")).findFirst();
    assertTrue(testFolder.isPresent());
    File dir = new File(testFolder.get());
    List<String> filesFound = getResourcesFromDirectory(dir, Pattern.compile(".*testFile.txt"))
            .collect(Collectors.toList());
    assertEquals(1, filesFound.size());
    assertEquals(0, getResourcesFromDirectory(null, null).count());
    assertEquals(0, getResourcesFromDirectory(dir, Pattern.compile("noMatch")).count());
}