public static Optional<Long> parseLong(final String value) {
        if (value == null || value.isEmpty()) {
            return Optional.empty();
        }
        try {
            return Optional.of(Long.valueOf(value));
        } catch (final NumberFormatException ignored) {
            return Optional.empty();
        }
    }
@param nullableString the string to check
@param value          the string to match against
@return {@code true} is nullableString is not null and contains the supplied value, otherwise {@code false}
xmppserver/src/main/java/org/jivesoftware/util/StringUtils.java