### Question:
PwnedPasswordChecker { public CompletableFuture<Boolean> asyncCheck(String password) { Hex hashedPassword = hashPassword(password); return client.fetchHashesAsync(hashedPassword).thenApplyAsync(x -> x.contains(hashedPassword)); } PwnedPasswordChecker(PwnedPasswordClient client); CompletableFuture<Boolean> asyncCheck(String password); boolean check(String password);  }### Answer:
@Test public void asyncMultipleHashesWithPasswordShouldFindPassword() throws ExecutionException, InterruptedException { PwnedPasswordClient client = Mockito.mock(PwnedPasswordClient.class); doAnswer(invocation -> CompletableFuture.completedFuture(Arrays.asList(Hex.from("5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8")))) .when(client).fetchHashesAsync(any()); Future<Boolean> f = new PwnedPasswordChecker(client).asyncCheck("test"); assertFalse(f.get()); }