void () { myFixture.configureByText("a.java", "class Foo {{ List<Pair<X, <caret>Y>> l; }}"); Set<TemplateContextType> contextTypeSet = TemplateManagerImpl .getApplicableContextTypes(TemplateActionContext.expanding(myFixture.getFile(), myFixture.getEditor())); List<Class<? extends TemplateContextType>> applicableContextTypesClasses = ContainerUtil.map(contextTypeSet, TemplateContextType::getClass); List<Class<JavaCodeContextType.Declaration>> declarationTypes = Arrays.asList(JavaCodeContextType.Declaration.class); assert applicableContextTypesClasses.equals(declarationTypes); }