PsiFileGist<Integer> () { IntRef invocationsHolder = new IntRef(0); String gistId = getTestName(true) + ".psiGistReturningCalculationsCount"; return GistManager.getInstance().newPsiFileGist( gistId, /*version: */0, EnumeratorIntegerDescriptor.INSTANCE, p -> { invocationsHolder.inc(); return invocationsHolder.get(); } ); }