protected static Optional<Double> getAsDoubleValue(final Sequence sequence) {
        return Optional.ofNullable(sequence)
                .map(sequence2 -> {
                    if (sequence2 instanceof EmptyAtomicSequence) {
                        return null;
                    } else if (sequence2 instanceof DoubleValue) {
                        final double val = ((DoubleValue) sequence2).getDoubleValue();
                        LOGGER.debug("Got double value:\n{}", val);
                        return val;
                    } else {
                        return Double.parseDouble(sequence.toString());
                    }
                });
    }
Assert the number of times {@link ErrorReceiver#log(Severity, Location, String, String, Throwable)}
is called and get all the call args.

@param callCount Expected number of calls
@return All args used in the calls
stroom-pipeline/src/test/java/stroom/pipeline/xsltfunctions/AbstractXsltFunctionTest.java