void (@NotNull String code, String contextId) { final JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(getProject()).createCodeBlockCodeFragment(code, null, true); myFixture.configureFromExistingVirtualFile(fragment.getVirtualFile()); final Editor editor = myFixture.getEditor(); final Document document = editor.getDocument(); document.putUserData(StructuralSearchDialogKeys.STRUCTURAL_SEARCH_PATTERN_CONTEXT_ID, contextId); myFixture.testHighlighting(false, false, false); }