ModulePath () { if (myPath.isEmpty()) { return EMPTY; } final Collection<File> files = Collections.unmodifiableCollection(myPath); return new ModulePath() { @Override public Collection<? extends File> getPath() { return files; } @Override public String getModuleName(File pathElement) { return myMap.get(pathElement); } }; }