@VisibleForTesting
    List<Container> getContainersFromPreviousAttemptsUnsafe(final Object response) {
        if (getContainersFromPreviousAttemptsMethod.isPresent() && response != null) {
            try {
                @SuppressWarnings("unchecked")
                final List<Container> containers =
                        (List<Container>)
                                getContainersFromPreviousAttemptsMethod.get().invoke(response);
                if (containers != null && !containers.isEmpty()) {
                    return containers;
                }
            } catch (Exception t) {
                logger.error("Error invoking 'getContainersFromPreviousAttempts()'", t);
            }
        }

        return Collections.emptyList();
    }
@Test
    void testCallsGetContainersFromPreviousAttemptsMethodIfPresent() {
        final RegisterApplicationMasterResponseReflector
                registerApplicationMasterResponseReflector =
                        new RegisterApplicationMasterResponseReflector(LOG, HasMethod.class);

        final List<Container> containersFromPreviousAttemptsUnsafe =
                registerApplicationMasterResponseReflector.getContainersFromPreviousAttemptsUnsafe(
                        new HasMethod());

        assertThat(containersFromPreviousAttemptsUnsafe).hasSize(1);
    }