<p>
Test if two {@code long}s are equal.
</p>

@param fieldName
the field name
@param lhs
the left hand {@code long}
@param rhs
the right hand {@code long}
@return this
@throws IllegalArgumentException
if field name is {@code null}
488646
public DiffBuilder append(final String fieldName, final long lhs,
            final long rhs) {
        validateFieldNameNotNull(fieldName);

        if (objectsTriviallyEqual) {
            return this;
        }
        if (lhs != rhs) {
            diffs.add(new Diff<Long>(fieldName) {
                private static final long serialVersionUID = 1L;

                @Override
                public Long getLeft() {
                    return Long.valueOf(lhs);
                }

                @Override
                public Long getRight() {
                    return Long.valueOf(rhs);
                }
            });
        }
        return this;
    }
325299
public boolean equalsOnlyNames(NodeSchema otherSchema) {
        if (otherSchema == null) {
            return false;
        }

        if (otherSchema.size() != size()) {
            return false;
        }

        for (int colIndex = 0; colIndex < size(); colIndex++ ) {
            SchemaColumn col1 = otherSchema.getColumn(colIndex);
            SchemaColumn col2 = m_columns.get(colIndex);
            if (col1.compareNames(col2) != 0) {
                return false;
            }
        }

        return true;
    }
703277
public static long objectFieldOffset(Class<?> clazz, String fieldName) {
    try {
      return UNSAFE.objectFieldOffset(clazz.getDeclaredField(fieldName));
    } catch (NoSuchFieldException | SecurityException e) {
      throw new Error(e);
    }
  }
946059
public static long getLong(JsonObject object, String field, long defaultValue) {
        final JsonValue value = object.get(field);
        if (value == null || value.isNull()) {
            return defaultValue;
        } else {
            return value.asLong();
        }
    }
416700
private static int extractNonMatchingFields(Tuple<Type.Field> lhsFields, Tuple<Type.Field> rhsFields,
			Type.Field[] result, int index) {
		outer: for (int i = 0; i != lhsFields.size(); ++i) {
			for (int j = 0; j != rhsFields.size(); ++j) {
				Type.Field lhsField = lhsFields.get(i);
				Type.Field rhsField = rhsFields.get(j);
				Identifier lhsFieldName = lhsField.getName();
				Identifier rhsFieldName = rhsField.getName();
				if (lhsFieldName.equals(rhsFieldName)) {
					// This is a matching field. Therefore, continue on to the
					// next lhs field
					continue outer;
				}
			}
			result[index++] = lhsFields.get(i);
		}
		return index;
	}
230555
public OptionBuilder withLongForm( String longForm )
    {
        if (option.getLongForm() != null) throw new IllegalArgumentException( "Long form given twice" );
        option.setLongForm( longForm );
        return this;
    }
894466
public void addField(String fieldName) throws QueryException {
		EReference feature = null;
		for (TypeDef typeDef : types) {
			if (typeDef.geteClass().getEStructuralFeature(fieldName) == null) {
				throw new QueryException("Class \"" + typeDef.geteClass().getName() + "\" does not have the field \"" + fieldName + "\"");
			}
			if (feature == null) {
				if (!(typeDef.geteClass().getEStructuralFeature(fieldName) instanceof EReference)) {
					throw new QueryException(fieldName + " is not a reference");
				}
				feature = (EReference) typeDef.geteClass().getEStructuralFeature(fieldName);
			} else {
				if (feature != typeDef.geteClass().getEStructuralFeature(fieldName)) {
					throw new QueryException("Classes \"" + typeDef.geteClass().getName() + "\" and \"" + feature.getEContainingClass().getName() + "\" have fields with the same name, but they are not logically the same");
				}
			}
		}
		if (fields == null) {
			fields = new ArrayList<>();
		}
		fields.add(feature);
	}
209351
@GwtIncompatible("incompatible method")
    private static void register(final Object lhs, final Object rhs) {
        Set<Pair<IDKey, IDKey>> registry = getRegistry();
        if (registry == null) {
            registry = new HashSet<>();
            REGISTRY.set(registry);
        }
        final Pair<IDKey, IDKey> pair = getRegisterPair(lhs, rhs);
        registry.add(pair);
    }
333802
private Type.Field[] determinePivotFields(Tuple<Type.Field> lhsFields, Tuple<Type.Field> rhsFields,
			LifetimeRelation lifetimes, LinkageStack stack) {
		Type.Field[] pivots = new Type.Field[lhsFields.size()];
		//
		for (int i = 0; i != lhsFields.size(); ++i) {
			Type.Field lhsField = lhsFields.get(i);
			Identifier lhsFieldName = lhsField.getName();
			for (int j = 0; j != rhsFields.size(); ++j) {
				Type.Field rhsField = rhsFields.get(j);
				Identifier rhsFieldName = rhsField.getName();
				if (lhsFieldName.equals(rhsFieldName)) {
					// Matched field, now compute its type.
					Type type = apply(lhsField.getType(), rhsField.getType(), lifetimes, stack);
					// Check whether is a pivot or not
					if (!(type instanceof Type.Void)) {
						// Yes, is a pivot
						pivots[i] = new Type.Field(lhsFieldName, type);
					}
					break;
				}
			}
		}
		return pivots;
	}
1159527
@Override public synchronized Long hdel(String key, String field, String ... fields) throws WrongTypeException {
        checkType(key, "hash");
        if (!exists(key)) {
            return 0L;
        }
        Long count = 0L;
        if (hashCache.removeValue(key, field)) {
            count += 1L;
        }
        for (String f : fields) {
            if (hashCache.removeValue(key, f)) {
                count += 1L;
            }
        }
        if (count > 0L) {
            keyModified(key);
        }
        return count;
    }
429223
void addField(final String name, final long value)
            throws IllegalStateException {

        addField(name, Long.toString(value));

    }
1152864
static boolean isJavaBaseAssignable( Class<?> lhsType, Class<?> rhsType )
    {
        /*
            Assignment to loose type, defer to bsh extensions
            Note: we could shortcut this here:
            if ( lhsType == null ) return true;
            rather than forcing another round.  It's not strictly a Java issue,
            so does it belong here?
        */
        if ( lhsType == null )
            return false;

        // null rhs type corresponds to type of Primitive.NULL assignable to any
        // object type but we give preference here to string types
        if ( rhsType == null )
            return lhsType == String.class;

        if ( lhsType.isPrimitive() && rhsType.isPrimitive() ) {
            if ( lhsType == rhsType )
                return true;

            // handle primitive widening conversions - JLS 5.1.2
            if ( NUMBER_ORDER.containsKey(rhsType)
                    && NUMBER_ORDER.containsKey(lhsType) )
                return NUMBER_ORDER.get(rhsType) < NUMBER_ORDER.get(lhsType);
        }
        else if ( lhsType.isAssignableFrom(rhsType) )
            return true;

        return false;
    }
452078
public IDocumentQuery<T> whereLessThanOrEqual(String fieldName, Object value) {
        return whereLessThanOrEqual(fieldName, value, false);
    }
1248840
public static boolean compare(Oid lhs, Oid rhs) {
		if (lhs == null || rhs == null)
			return (lhs == rhs);
		return lhs.equals(rhs);
	}
890637
public final Long getLong(final String pNm) throws ExceptionWithCode {
    if (this.longs != null && this.longs.keySet().contains(pNm)) {
      return this.longs.get(pNm);
    }
    if (this.idLongs != null && this.idLongs.keySet().contains(pNm)) {
      return this.idLongs.get(pNm);
    }
    throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
      "There is no field - " + pNm);
  }
631562
private static Field matchClassField(Class clazz, String fieldName) {

        List<Field> fields = new ArrayList<>();
        for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
            fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
        }
        for (Field field : fields) {
            if (fieldName.equals(field.getName())) {
                return field;
            }
        }
        throw new IllegalArgumentException("[" + clazz.getName() + "] can`t found field with [" + fieldName + "]");
    }
794595
@Override
    public long getLong(TemporalField field) {
        if (field instanceof ChronoField) {
            switch ((ChronoField) field) {
                case ALIGNED_DAY_OF_WEEK_IN_MONTH:
                    return month == 0 ? 0 : super.getLong(field);
                case ALIGNED_DAY_OF_WEEK_IN_YEAR:
                    return getDayOfWeek();
                case ALIGNED_WEEK_OF_MONTH:
                    return month == 0 ? 0 : super.getLong(field);
                case ALIGNED_WEEK_OF_YEAR:
                    if (month == 0) {
                        return 0;
                    } else {
                        return ((getDayOfYear() - (getDayOfYear() >= ST_TIBS_OFFSET && isLeapYear() ? 1 : 0) - 1) / DAYS_IN_WEEK) + 1;
                    }
                default:
                    break;
            }
        }
        return super.getLong(field);
    }