false or null first (client first)
507369
static int compareShared(Span left, Span right) {
    // If either are shared put it last
    boolean leftShared = Boolean.TRUE.equals(left.shared());
    boolean rightShared = Boolean.TRUE.equals(right.shared());
    if (leftShared && rightShared) return 0; // both are shared, so skip out
    if (leftShared) return 1;
    if (rightShared) return -1;

    // neither are shared, put the client spans first
    boolean leftClient = Span.Kind.CLIENT.equals(left.kind());
    boolean rightClient = Span.Kind.CLIENT.equals(right.kind());
    if (leftClient && rightClient) return 0;
    if (leftClient) return -1;
    if (rightClient) return 1;
    return 0; // neither are client spans
  }
743503
public static <T> boolean isEqual(final T first, final T second) {
        /* test to see if they are both null, or both reference the same object */
        if (first == second) return true;

        if (first == null && second != null) return false;

        return first.equals(second);
    }
500041
function firstOrDefault(expression) {

        //Define output
		var outData;
		
		//If there's no expression
		if (!expression){
		
			//Just assign current items
			outData = this.items;
		}
		else{
		
			//Otherwise apply where condition
			outData = jslinq(this.items)
				.where(expression)
				.toList();
		}

        //If output list does not contains element, return null
        if (outData.length === 0)
            return null;
			
		//Return first element
		return outData[0];
    }
341296
private function _first(callable $callback = null)
    {
        $values = $this->getValues();
        if ($callback){
            foreach($values as $key => $value){
                if ($callback($value, $key)){
                    return $value;
                }
            }
        }
        else{
            return empty($values) ? null : $values[0];
        }
        return null;
    }
369264
@Nullable
  public ResultT first() {
    final CoreRemoteMongoCursor<ResultT> cursor = iterator();
    if (!cursor.hasNext()) {
      return null;
    }
    return cursor.next();
  }
1112005
function isNotNull(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && value === null) {
        throw ValueException.expectedValue(assertionTypes.IS_NOT_NULL, value, null, message, id);
    }
}
398966
public static <T> T checkNotNull(T value) throws NullPointerException {
    if (value == null) {
      throw new NullPointerException();
    }
    return value;
  }
1139276
public QueryResult<T> first() {
        if (response != null && response.size() > 0) {
            return response.get(0);
        }
        return null;
    }
85642
@SuppressWarnings("unchecked")
	public static <T> T firstNonNull(T... array) {
		if (isNotEmpty(array)) {
			for (final T val : array) {
				if (null != val) {
					return val;
				}
			}
		}
		return null;
	}
458075
private static boolean checkInitialize(Method method, Object obj) {
        boolean isInitialized = true;
        
        try {
            isInitialized = (Boolean) method.invoke(null, new Object[] {obj});
        } catch (IllegalArgumentException e) {
		   // do nothing
        } catch (IllegalAccessException e) {
		   // do nothing
        } catch (InvocationTargetException e) {
		   // do nothing
        }
        return isInitialized;
    }
327959
@Override
	public Later<JsonNode> queryFirst(String fql) {
		Later<ArrayNode> q = this.query(fql);
		return new FirstNodeLater(q);
	}
930074
public static void validateNull(String name, Object object) {
		if (object == null) {
			throw new IllegalStateException(name.concat(" cannot be null"));
		}
	}
584547
public static void validateNull( Object object, String identifier )
        throws PostConditionException
    {
        if( object == null )
        {
            return;
        }
        throw new PostConditionException( identifier + " was NOT NULL." );
    }
85633
def is_first(self, value):
        
        if value == self._defaults['ai.session.isFirst'] and 'ai.session.isFirst' in self._values:
            del self._values['ai.session.isFirst']
        else:
            self._values['ai.session.isFirst'] = value
51018
public void validateNull(Object object, String name) {
        validateNull(object, name, messages.get(Validation.NULL_KEY.name(), name));
    }
1086846
public static boolean atLeastOneNotNull(final Object... o1s) {
        if (o1s != null && o1s.length > 0) {
            for (final Object o1 : o1s) {
                if (o1 != null) {
                    return true;
                }
            }
        }
        return false;
    }
1299183
@Override
	public Optional<E> first() {
		try (Stream<E> stream = stream()) {
			return stream.findFirst();
		}
	}