void () { final PsiFile[] files = myFixture.configureByFiles("i18n.properties", "MyClass.java"); final PsiFile propertiesFile = files[0]; final PsiFile javaSourceFile = files[1]; myFixture.renameElement(propertiesFile, "i19n.properties"); boolean[] found = {false}; PsiTreeUtil.processElements(javaSourceFile, new PsiElementProcessor() { @Override public boolean execute(@NotNull PsiElement element) { if (PlatformPatterns.psiElement(PsiField.class).withName("BUNDLE_NAME").accepts(element)) { assertEquals("i19n", ((PsiLiteralExpression)((PsiField)element).getInitializer()).getValue()); found[0] = true; } return true; } }); assertTrue(found[0]); }