boolean (@NotNull VcsRef reference) { if (reference.getType().equals(HEAD) || reference.getType().equals(TIP)) return true; if (!reference.getType().isBranch()) return false; return myProject.getService(HgBranchManager.class) .isFavorite(getBranchType(reference), getRepository(reference), reference.getName()); }