### Question:
InstanceRegistry { public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); } InstanceRegistry(InstanceRepository repository, InstanceIdGenerator generator); Mono<InstanceId> register(Registration registration); Flux<Instance> getInstances(); Flux<Instance> getInstances(String name); Mono<Instance> getInstance(InstanceId id); Mono<InstanceId> deregister(InstanceId id);  }### Answer:
@Test public void deregister() { InstanceId id = registry.register(Registration.create("abc", "http: registry.deregister(id).block(); StepVerifier.create(registry.getInstance(id)) .assertNext(app -> assertThat(app.isRegistered()).isFalse()) .verifyComplete(); }
@Test public void deregister() { InstanceId id = registry.register(Registration.create("abc", "http: registry.deregister(id).block(); StepVerifier.create(registry.getInstance(id)).assertNext((app) -> assertThat(app.isRegistered()).isFalse()) .verifyComplete(); }