@Override
    public void setAttemptCount(JobVertexID jobVertexId, int subtaskIndex, int attemptNumber) {
        Preconditions.checkArgument(subtaskIndex >= 0);
        Preconditions.checkArgument(attemptNumber >= 0);

        final List<Integer> attemptCounts =
                vertexSubtaskToAttemptCounts.computeIfAbsent(
                        jobVertexId, ignored -> new ArrayList<>(32));
        while (subtaskIndex >= attemptCounts.size()) {
            attemptCounts.add(0);
        }
        attemptCounts.set(subtaskIndex, attemptNumber);
    }
@Test
    void testSetAttemptCount() {
        final DefaultVertexAttemptNumberStore vertexAttemptNumberStore =
                new DefaultVertexAttemptNumberStore();

        final JobVertexID jobVertexId = new JobVertexID();
        final int subtaskIndex = 4;
        final int attemptCount = 2;

        vertexAttemptNumberStore.setAttemptCount(jobVertexId, subtaskIndex, attemptCount);
        assertThat(
                        vertexAttemptNumberStore
                                .getAttemptCounts(jobVertexId)
                                .getAttemptCount(subtaskIndex))
                .isEqualTo(attemptCount);
    }