private static Mono<AbstractApplicationResource> requestUpdateApplication(CloudFoundryClient cloudFoundryClient, String applicationId, UnaryOperator<UpdateApplicationRequest.Builder> modifier) {
return cloudFoundryClient.applicationsV2()
.update(modifier.apply(UpdateApplicationRequest.builder()
.applicationId(applicationId))
.build())
<BUG>.map(OperationUtils.<UpdateApplicationResponse, AbstractApplicationResource>cast());
}</BUG>
private static Mono<AbstractApplicationResource> requestUpdateApplicationEnvironment(CloudFoundryClient cloudFoundryClient, String applicationId, Map<String, Object> environment) {
return requestUpdateApplication(cloudFoundryClient, applicationId, builder -> builder.environmentJsons(environment));
}

private static Mono<AbstractApplicationResource> requestUpdateApplication(CloudFoundryClient cloudFoundryClient, String applicationId, UnaryOperator<UpdateApplicationRequest.Builder> modifier) {
return cloudFoundryClient.applicationsV2()
.update(modifier.apply(UpdateApplicationRequest.builder()
.applicationId(applicationId))
.build())
.cast(AbstractApplicationResource.class);
}
private static Mono<AbstractApplicationResource> requestUpdateApplicationEnvironment(CloudFoundryClient cloudFoundryClient, String applicationId, Map<String, Object> environment) {
return requestUpdateApplication(cloudFoundryClient, applicationId, builder -> builder.environmentJsons(environment));
}
