private static boolean mayExpectBoolean(CompletionParameters parameters) {
    for (ExpectedTypeInfo info : JavaSmartCompletionContributor.getExpectedTypes(parameters)) {
      PsiType type = info.getType();
      if (type instanceof PsiClassType || PsiTypes.booleanType().equals(type)) return true;
    }
    return false;
  }
private static boolean mayExpectBoolean(CompletionParameters parameters)