public static boolean isPositiveInfinity(final Object value) {
        return (value instanceof Float && Float.POSITIVE_INFINITY == ((float) value)) ||
                (value instanceof Double && Double.POSITIVE_INFINITY == ((double) value));
    }
Coerces the given number to the specified numeric type if it can fit into it.
Otherwise, retains the original type.

@param a the number to be coerced
@param clazz the target numeric type class
@return the coerced number in the specified type or the original type if it cannot fit
@throws IllegalArgumentException if the specified numeric type is unsupported
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java