### Question:
DefaultBackingAppDeploymentService implements BackingAppDeploymentService { @Override public Flux<String> undeploy(List<BackingApplication> backingApps) { return Flux.fromIterable(backingApps) .parallel() .runOn(Schedulers.parallel()) .flatMap(deployerClient::undeploy) .sequential() .doOnRequest(l -> { LOG.info("Undeploying applications"); LOG.debug(BACKINGAPPS_LOG_TEMPLATE, backingApps); }) .doOnComplete(() -> { LOG.info("Finish undeploying applications"); LOG.debug(BACKINGAPPS_LOG_TEMPLATE, backingApps); }) .doOnError(e -> { LOG.error(String.format("Error undeploying applications. error=%s", e.getMessage()), e); LOG.debug(BACKINGAPPS_LOG_TEMPLATE, backingApps); }); } DefaultBackingAppDeploymentService(DeployerClient deployerClient); @Override Flux<String> deploy(List<BackingApplication> backingApps, String serviceInstanceId); @Override Flux<String> update(List<BackingApplication> backingApps, String serviceInstanceId); @Override Flux<String> undeploy(List<BackingApplication> backingApps);  }### Answer:
@Test @SuppressWarnings("UnassignedFluxMonoInstance") void shouldUndeployApplications() { doReturn(Mono.just("deleted1")) .when(deployerClient).undeploy(backingApps.get(0)); doReturn(Mono.just("deleted2")) .when(deployerClient).undeploy(backingApps.get(1)); List<String> expectedValues = new ArrayList<>(); expectedValues.add("deleted1"); expectedValues.add("deleted2"); StepVerifier.create(backingAppDeploymentService.undeploy(backingApps)) .expectNextMatches(expectedValues::remove) .expectNextMatches(expectedValues::remove) .verifyComplete(); }