yes, `withValue` would work for both java and scala