@Override
    protected SubtaskExecutionAttemptAccumulatorsInfo handleRequest(
            HandlerRequest<EmptyRequestBody> request, AccessExecution execution)
            throws RestHandlerException {
        return createAccumulatorInfo(execution);
    }
@Test
    void testHandleRequest() throws Exception {

        // Instance the handler.
        final RestHandlerConfiguration restHandlerConfiguration =
                RestHandlerConfiguration.fromConfiguration(new Configuration());

        final SubtaskExecutionAttemptAccumulatorsHandler handler =
                new SubtaskExecutionAttemptAccumulatorsHandler(
                        () -> null,
                        Time.milliseconds(100L),
                        Collections.emptyMap(),
                        SubtaskExecutionAttemptAccumulatorsHeaders.getInstance(),
                        new DefaultExecutionGraphCache(
                                restHandlerConfiguration.getTimeout(),
                                Time.milliseconds(restHandlerConfiguration.getRefreshInterval())),
                        Executors.directExecutor());

        // Instance a empty request.
        final HandlerRequest<EmptyRequestBody> request =
                HandlerRequest.create(
                        EmptyRequestBody.getInstance(), new SubtaskAttemptMessageParameters());

        final Map<String, OptionalFailure<Accumulator<?, ?>>> userAccumulators = new HashMap<>(3);
        userAccumulators.put("IntCounter", OptionalFailure.of(new IntCounter(10)));
        userAccumulators.put("LongCounter", OptionalFailure.of(new LongCounter(100L)));
        userAccumulators.put(
                "Failure", OptionalFailure.ofFailure(new FlinkRuntimeException("Test")));

        // Instance the expected result.
        final StringifiedAccumulatorResult[] accumulatorResults =
                StringifiedAccumulatorResult.stringifyAccumulatorResults(userAccumulators);

        final int attemptNum = 1;
        final int subtaskIndex = 2;

        // Instance the tested execution.
        final ArchivedExecution execution =
                new ArchivedExecution(
                        accumulatorResults,
                        null,
                        createExecutionAttemptId(new JobVertexID(), subtaskIndex, attemptNum),
                        ExecutionState.FINISHED,
                        null,
                        null,
                        null,
                        new long[ExecutionState.values().length],
                        new long[ExecutionState.values().length]);

        // Invoke tested method.
        final SubtaskExecutionAttemptAccumulatorsInfo accumulatorsInfo =
                handler.handleRequest(request, execution);

        final ArrayList<UserAccumulator> userAccumulatorList =
                new ArrayList<>(userAccumulators.size());
        for (StringifiedAccumulatorResult accumulatorResult : accumulatorResults) {
            userAccumulatorList.add(
                    new UserAccumulator(
                            accumulatorResult.getName(),
                            accumulatorResult.getType(),
                            accumulatorResult.getValue()));
        }

        final SubtaskExecutionAttemptAccumulatorsInfo expected =
                new SubtaskExecutionAttemptAccumulatorsInfo(
                        subtaskIndex,
                        attemptNum,
                        execution.getAttemptId().toString(),
                        userAccumulatorList);

        // Verify.
        assertThat(accumulatorsInfo).isEqualTo(expected);
    }