@Override
  public ReservationListResponse listReservations(
      ReservationListRequest request) throws YarnException, IOException {
    if (request == null || request.getReservationId() == null) {
      routerMetrics.incrListReservationsFailedRetrieved();
      String msg = "Missing listReservations request.";
      RouterAuditLogger.logFailure(user.getShortUserName(), LIST_RESERVATIONS, UNKNOWN,
          TARGET_CLIENT_RM_SERVICE, msg);
      RouterServerUtil.logAndThrowException(msg, null);
    }
    long startTime = clock.getTime();
    ClientMethod remoteMethod = new ClientMethod("listReservations",
        new Class[] {ReservationListRequest.class}, new Object[] {request});
    Collection<ReservationListResponse> listResponses = null;
    try {
      listResponses = invokeConcurrent(remoteMethod, ReservationListResponse.class);
    } catch (Exception ex) {
      String msg = "Unable to list reservations node due to exception.";
      routerMetrics.incrListReservationsFailedRetrieved();
      RouterAuditLogger.logFailure(user.getShortUserName(), LIST_RESERVATIONS, UNKNOWN,
          TARGET_CLIENT_RM_SERVICE, msg);
      RouterServerUtil.logAndThrowException(msg, ex);
    }
    long stopTime = clock.getTime();
    routerMetrics.succeededListReservationsRetrieved(stopTime - startTime);
    RouterAuditLogger.logSuccess(user.getShortUserName(), LIST_RESERVATIONS,
        TARGET_CLIENT_RM_SERVICE);
    // Merge the ReservationListResponse
    return RouterYarnClientUtils.mergeReservationsList(listResponses);
  }
@Test
  public void testListReservations() throws Exception {
    LOG.info("Test FederationClientInterceptor :  Get ListReservations request.");

    // null request
    LambdaTestUtils.intercept(YarnException.class, "Missing listReservations request.",
        () -> interceptor.listReservations(null));

    // normal request
    ReservationId reservationId = ReservationId.newInstance(1653487680L, 1L);
    ReservationListResponse response = interceptor.listReservations(
        ReservationListRequest.newInstance("root.decided", reservationId.toString()));
    Assert.assertNotNull(response);
    Assert.assertEquals(0, response.getReservationAllocationState().size());
  }