List<MavenResource> (List<MavenResource> resources, @NotNull String defaultDir) { List<MavenResource> result = new ArrayList<>(); if (resources.isEmpty()) { result.add(createResource(defaultDir)); return result; } for (MavenResource each : resources) { if (isEmptyOrSpaces(each.getDirectory())) continue; result.add(each); } return result; }