private static @Nullable PsiExpression getFieldReferenceQualifier(PsiElement current, String fieldName) {
    PsiElement e = PsiTreeUtil.nextVisibleLeaf(current);
    if (!(e instanceof PsiJavaToken) || !((PsiJavaToken)e).getTokenType().equals(JavaTokenType.DOT)) return null;
    PsiElement parent = e.getParent();
    if (!(parent instanceof PsiReferenceExpression)) return null;
    if (parent.getParent() instanceof PsiMethodCallExpression) return null;
    PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(((PsiReferenceExpression)parent).getQualifierExpression());
    if (!mayBeNull(qualifier)) return null;
    if (!fieldName.equals(((PsiReferenceExpression)parent).getReferenceName())) return null;
    return qualifier;
  }
private static @Nullable PsiExpression getFieldReferenceQualifier(PsiElement current, String fieldName)