void (final String expectedMessage) { String filePath = BASE_PATH + "/" + getTestName(false) + ".java"; configureByFile(filePath); final PsiTypeCastExpression castExpression = PsiTreeUtil.getParentOfType(getFile().findElementAt(getEditor().getCaretModel().getOffset()), PsiTypeCastExpression.class); assertNotNull(castExpression); final PsiTypeElement castTypeElement = castExpression.getCastType(); assertNotNull(castTypeElement); final PsiType type = castTypeElement.getType(); final String errorMessage = LambdaHighlightingUtil.checkInterfaceFunctional(type); assertEquals(expectedMessage, errorMessage); }