### Question:
RestRemoteMole implements Mole { @Override public Flux<MissionState> statesFor(MissionHandle handle) { return clientUtils.flux(MoleWebApi.instanceStatesUrl(handle.id()), MissionStateDto.class) .map(MissionStateDto::toMissionState); } RestRemoteMole(String baseUrl); @Override Flux<AgencyState> states(); @Override Mono<MissionRepresentation> representationOf(Mission mission); @Override Mono<MissionParameterDescription> parameterDescriptionOf(Mission mission); @Override Flux<MissionState> statesFor(MissionHandle handle); @Override Flux<MissionOutput> outputsFor(MissionHandle handle); @Override Flux<MissionRepresentation> representationsFor(MissionHandle handle); @Override Mono<MissionHandle> instantiate(Mission mission, Map<String, Object> params); @Override void instruct(MissionHandle handle, Strand strand, StrandCommand command); @Override void instructRoot(MissionHandle handle, StrandCommand command); @Override void instructBlock(MissionHandle handle, String blockId, BlockCommand command); @Override void instruct(final MissionHandle handle, final MissionCommand command);  }### Answer:
@Test public void statesFor() { RestRemoteMole remoteMole = new RestRemoteMole(baseUrl); Flux<MissionState> states = remoteMole.statesFor(MissionHandle.ofId("missionHandleId")); Set<MissionState> statesSet = states.collect(Collectors.toSet()).block(); MissionState missionState = statesSet.iterator().next(); RunState runStateForStrand = missionState.runStateOf(Strand.ofId("strandId")); RunState runStateForBlock = missionState.runStateOf(BLOCK2); Result blockResult = missionState.resultOf(BLOCK2); assertThat(runStateForStrand).isEqualTo(RunState.PAUSED); assertThat(runStateForBlock).isEqualTo(RunState.FINISHED); assertThat(blockResult).isEqualTo(Result.SUCCESS); }
@Ignore @Test(expected = IllegalArgumentException.class) public void statesForReturnsError() { RestRemoteMole remoteMole = new RestRemoteMole(baseUrl); when(mole.statesFor(any())).thenThrow(new IllegalArgumentException("the mole is returning an error")); Flux<MissionState> states = remoteMole.statesFor(MissionHandle.ofId("anything")); }