Optional<String> writeGauge(Gauge gauge) {
        Double value = gauge.value();
        if (Double.isFinite(value)) {
            return Optional.of(writeDocument(gauge, builder -> {
                builder.append(",\"value\":").append(value);
            }));
        }
        return Optional.empty();
    }
Optional < String > writeGauge ( Gauge gauge ) { Double value = gauge . value ( ) ; if ( Double . isFinite ( value ) ) { return Optional . of ( writeDocument ( gauge , builder -> { builder . append ( ",\"value\":" ) . append ( value ) ; } ) ) ; } return Optional . empty ( ) ; }
VisibleForTesting