public static Optional<Double> parseDouble(final String value) {
        if (value == null || value.isEmpty()) {
            return Optional.empty();
        }
        try {
            return Optional.of(Double.valueOf(value));
        } catch (final NumberFormatException ex) {
            Log.trace("An exception occurred while trying to parse value '{}' as long. Will return empty.", value, ex);
            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