public CompletableFuture<Optional<Account>> getByUsernameHash(final byte[] usernameHash) {
    final Timer.Sample sample = Timer.start();
    return accounts.getByUsernameHash(usernameHash)
        .whenComplete((ignoredResult, ignoredThrowable) -> sample.stop(getByUsernameHashTimer));
  }
@Test
  void testGetAccountByUsernameHash() {
    UUID uuid = UUID.randomUUID();
    Account account = AccountsHelper.generateTestAccount("+14152222222", uuid, UUID.randomUUID(), new ArrayList<>(),
        new byte[UnidentifiedAccessUtil.UNIDENTIFIED_ACCESS_KEY_LENGTH]);
    account.setUsernameHash(USERNAME_HASH_1);
    when(accounts.getByUsernameHash(USERNAME_HASH_1))
        .thenReturn(CompletableFuture.completedFuture(Optional.of(account)));
    Optional<Account> retrieved = accountsManager.getByUsernameHash(USERNAME_HASH_1).join();
    assertTrue(retrieved.isPresent());
    assertSame(retrieved.get(), account);
    verify(accounts).getByUsernameHash(USERNAME_HASH_1);
    verifyNoMoreInteractions(accounts);
  }