private Set<Account> getAccounts(String accountName, Short accountId) throws Exception {
    HttpHeaders headers = new DefaultHttpHeaders();
    if (accountName != null) {
      headers.add(RestUtils.Headers.TARGET_ACCOUNT_NAME, accountName);
    } else if (accountId != null) {
      headers.add(RestUtils.Headers.TARGET_ACCOUNT_ID, accountId);
    }
    FullHttpRequest request = buildRequest(HttpMethod.GET, Operations.ACCOUNTS, headers, null);
    ResponseParts responseParts = nettyClient.sendRequest(request, null, null).get();
    HttpResponse response = getHttpResponse(responseParts);
    assertEquals("Unexpected response status", HttpResponseStatus.OK, response.status());
    verifyTrackingHeaders(response);
    ByteBuffer content = getContent(responseParts.queue, HttpUtil.getContentLength(response));
    return new HashSet<>(
        AccountCollectionSerde.accountsFromInputStreamInJson(new ByteArrayInputStream(content.array())));
  }
Call the {@code GET /accounts} API and deserialize the response.
@param accountName if non-null, fetch a single account by name instead of all accounts.
@param accountId if non-null, fetch a single account by ID instead of all accounts.
@return the accounts fetched.
ambry-frontend/src/integration-test/java/com/github/ambry/frontend/FrontendIntegrationTest.java