@Override
    public int getAttemptCount(int subtaskIndex) {
        Preconditions.checkArgument(subtaskIndex >= 0);
        if (subtaskIndex >= attemptCounts.size()) {
            return 0;
        }
        return attemptCounts.get(subtaskIndex);
    }
@Test
    void testOutOfBoundsSubtaskIndexReturnsZero() {
        final List<Integer> initialAttemptCounts = Arrays.asList(1, 2, 3);
        final DefaultSubtaskAttemptNumberStore subtaskAttemptNumberStore =
                new DefaultSubtaskAttemptNumberStore(initialAttemptCounts);

        assertThat(subtaskAttemptNumberStore.getAttemptCount(initialAttemptCounts.size() * 2))
                .isZero();
    }