public static PsiType @NotNull [] getExpectedTypes(final PsiElement context, boolean defaultTypes) {
    PsiExpression expression = PsiTreeUtil.getContextOfType(context, PsiExpression.class, true);
    if (expression == null) {
      return PsiType.EMPTY_ARRAY;
    }
    return extractTypes(ExpectedTypesProvider.getExpectedTypes(expression, true), defaultTypes);
  }
public static PsiType @NotNull [] getExpectedTypes(final PsiElement context, boolean defaultTypes)