We are trying to see if (1) we are in a method guaranteed to return something non-null, and (2)
this return statement can return something null.
517324
@Override
  public Description matchReturn(ReturnTree tree, VisitorState state) {
    if (!matchWithinClass) {
      return Description.NO_MATCH;
    }
    handler.onMatchReturn(this, tree, state);
    ExpressionTree retExpr = tree.getExpression();
    // let's do quick checks on returned expression first
    if (retExpr == null) {
      return Description.NO_MATCH;
    }
    // now let's check the enclosing method
    TreePath enclosingMethodOrLambda =
        NullabilityUtil.findEnclosingMethodOrLambdaOrInitializer(state.getPath());
    if (enclosingMethodOrLambda == null) {
      throw new RuntimeException("no enclosing method, lambda or initializer!");
    }
    if (!(enclosingMethodOrLambda.getLeaf() instanceof MethodTree
        || enclosingMethodOrLambda.getLeaf() instanceof LambdaExpressionTree)) {
      throw new RuntimeException(
          "return statement outside of a method or lambda! (e.g. in an initializer block)");
    }
    Tree leaf = enclosingMethodOrLambda.getLeaf();
    Symbol.MethodSymbol methodSymbol;
    if (leaf instanceof MethodTree) {
      MethodTree enclosingMethod = (MethodTree) leaf;
      methodSymbol = ASTHelpers.getSymbol(enclosingMethod);
    } else {
      // we have a lambda
      methodSymbol =
          NullabilityUtil.getFunctionalInterfaceMethod(
              (LambdaExpressionTree) leaf, state.getTypes());
    }
    return checkReturnExpression(tree, retExpr, methodSymbol, state);
  }
74076
function() {
          var methodString = 'expected ' + object.toString() + '.' + method + '()' + (negate ? ' not' : '' )
          
          function times(n) {
            return n > 2 ?  n + ' times' : { 1: 'once', 2: 'twice' }[n]
          }
          
          if (this.expectedResult != null && (negate ? this.anyResultsPass() : this.anyResultsFail()))
            this.message = methodString + ' to return ' + puts(this.expectedResult) + 
              ' but ' + (negate ? 'it did' : 'got ' + puts(this.failingResult())) 

          if (this.expectedArgs && (negate ? !this.expectedResult && this.anyArgsPass() : this.anyArgsFail()))
            this.message = methodString + ' to be called with ' + puts.apply(this, this.expectedArgs) +
             ' but was' + (negate ? '' : ' called with ' + puts.apply(this, this.failingArgs()))

          if (negate ? !this.expectedResult && !this.expectedArgs && this.calls.length >= this.times : this.calls.length != this.times)
            this.message = methodString + ' to be called ' + times(this.times) + 
            ', but ' +  (this.calls.length == 0 ? ' was not called' : ' was called ' + times(this.calls.length))
                
          if (!this.message.length) 
            this.passed = true
          
          return this
        }
119446
public static final <X> Function<X,Boolean> isNotNullBy(final IFunction<X,?> by) {
        return FnFunc.chain(by, FnObject.isNotNull());
    }
770932
protected void validateDeclaredReturns() {
        boolean returnsObject = void.class != method.getReturnType();
        if (returnsObject) {
            for (Return declaredReturn : declaredReturns) {
                if (declaredReturn.code() >= 200 && declaredReturn.code() < 300) {
                    return;
                }
            }
            throw new FatalException("{} returns an object but does not declare a successful @{}(code=200, onResult={}.class)",
                    Util.toString(method), Return.class.getSimpleName(), method.getReturnType().getSimpleName());
        }
    }
750845
public static <E> boolean checkEq(E obj1, E obj2) {
	if(obj1 == null) return obj2 == null;
	// make sure we do this short-circuit, just in case it's not done by equals
	if(obj1 == obj2) return true;
	return obj1.equals(obj2);
    }
778323
public static void checkNotNull(Object o, String msg, int arg1) {
        if (o == null) {
            throwNullPointerEx(msg, arg1);
        }
    }
302021
public final boolean hasReturnValues()
    {
        if (this.hasReturnValue())
        {
            return true;
        }
        else
        {
            // TODO: We may be able to 'pre-calculate' the results
            // of this loop by just checking arguments as they are added
            // The only problem is that the 'isReturnedbyProcedure' property
            // can be modified once the argument is added to this procedure.
            // If that occurs, then 'pre-calculated' results will be inacccurate.
            Iterator iter = this.getArguments().iterator();
            while (iter.hasNext())
            {
                ArgumentDescriptor arg = (ArgumentDescriptor) iter.next();
                if (arg.getIsReturnedByProcedure())
                {
                    return true;
                }
            }
        }
        return false;
    }
1303866
def check_return(callable_name: str, r: typing.Any,
                 hints: typing.Mapping[str, type]) -> None:
    
    correct = True
    if 'return' not in hints:
        return
    _, correct = check_type(r, hints['return'])
    if not correct:
        raise TypeError(
            'Incorrect return type `{}`, expected {}. for: {}'.format(
                type(r), hints.get('return'), callable_name
            )
        )
62443
@Nonnull
    public static <T> T checkNotNull(T value, @Nonnull String errorMessage) {
        if (value == null) {
            throw new NullPointerException(errorMessage);
        }
        return value;
    }
398966
public static <T> T checkNotNull(T value) throws NullPointerException {
    if (value == null) {
      throw new NullPointerException();
    }
    return value;
  }
917818
private boolean unequal(Object expected, Object actual) {
        return expected==null ? actual!=null : unequalNotNull(expected, actual);
    }
312025
public boolean negates( IAssertion other)
    {
    Assert assertion =
      other != null && other.getClass().equals( Assert.class)
      ? (Assert) other
      : null;

    return
      assertion != null
      && assertion.getProperty().equals( getProperty());
    }
868490
function isReturnAssignException(node) {
			if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) {
				return false;
			}

			if (node.type === "ReturnStatement") {
				return node.argument && containsAssignment(node.argument);
			} else if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") {
				return containsAssignment(node.body);
			}
			return containsAssignment(node);
		}
1065297
public void toEqual(T other) {
		if (this.value == null && other == null) {
			return;
		}
		expectNotNull(this.value, "Expected null to be equal '%s'", other);
		expectNotNull(other, "Expected '%s' to be equal null", this.value);
		expectTrue(this.value.equals(other), "Expected '%s' to be equal '%s'", this.value, other);
	}
1286731
function(x) {
  return _.isUndefined(x) || _.isNull(x) || _.isNaN(x);
}
479117
@Nonnull
  public static <T> T ensureNonNull(@Nonnull final T value) {
    return Assertions.assertNotNull(value);
  }
99578
function alwaysReturns(node) {
            if (node.type === "BlockStatement") {

                // If we have a BlockStatement, check each consequent body node.
                return node.body.some(checkForReturnOrIf);
            }

            /*
             * If not a block statement, make sure the consequent isn't a
             * ReturnStatement or an IfStatement with returns on both paths.
             */
            return checkForReturnOrIf(node);
        }