public StringChecker asString() {
    return new StringChecker(
        optionalValue.isPresent()
            ? optionalValue.get().toString()
            : null, false);
  }
The optional match wrapper.
@param <T> the generic type
testing/src/org/immutables/check/OptionalChecker.java