You can use OAuth2CodeGrantFlow.Builder#property(...) method to set the state
parameter:
final OAuth2CodeGrantFlow codeGrantFlow = OAuth2ClientSupport
.googleFlowBuilder(clientIdentifier, redirectURI, scope)
.prompt(OAuth2FlowGoogleBuilder.Prompt.CONSENT)
.property(OAuth2CodeGrantFlow.Phase.AUTHORIZATION, OAuth2Parameters.STATE, state)
.build();
I agree, it's not very convenient. If you have a legitimate use-case to modify builder/flow, feel free to file an improvement to our JIRA.