public StructureFilter() { myMap = AreaMap.create( new PairProcessor<String, String>() { public boolean process(final String candidate, final String key) { return key.startsWith(candidate); } }); myMemoryFilter = new MemoryFilter() { public boolean applyInMemory(GitHeavyCommit commit) { if (myMap.isEmpty()) return true; final List<FilePath> pathList = commit.getPathsList(); final Ref<Boolean> found = new Ref<Boolean>(); for (FilePath filePath : pathList) { myMap.getSimiliar( FilePathsHelper.convertWithLastSeparator(filePath), new PairProcessor<String, VirtualFile>() { public boolean process(String s, VirtualFile virtualFile) { found.set(true); // take only first.. should be only first return true; } }); if (Boolean.TRUE.equals(found.get())) break; } return Boolean.TRUE.equals(found.get()); } }; }