class ScoreCardServiceLoaderImpl implements ScoreCardServiceLoader {

    public Set<String> find(final Path path,
                            final String packageName) {
        final Set<String> result = new HashSet<>();

        try {
            final WorkspaceProject workspaceProject = projectService.resolveProject(path);

            final List<RefactoringPageRow> rows = refactoringQueryService.query(FindScorecardNamesQuery.NAME,
                                                                                new HashSet<ValueIndexTerm>() {{
                                                                                    add(new ValueSharedPartIndexTerm(
                                                                                            "*",
                                                                                            PartType.SCORECARD_MODEL_NAME,
                                                                                            ValueIndexTerm.TermSearchType.WILDCARD));
                                                                                    add(new ValueModuleRootPathIndexTerm(
                                                                                            workspaceProject.getMainModule().getRootPath().toURI()));
                                                                                    add(new ValuePackageNameIndexTerm(
                                                                                            packageName));
                                                                                }});

            for (RefactoringPageRow row : rows) {
                result.add(row.getValue().toString());
            }
        } finally {
            return result;
        }
    }

}