public static long validateMillisecondInstant(final Instant instant, final String messagePrefix) {
        try {
            if (instant == null) {
                throw new IllegalArgumentException(messagePrefix + VALIDATE_MILLISECOND_NULL_SUFFIX);
            }

            return instant.toEpochMilli();
        } catch (final ArithmeticException e) {
            throw new IllegalArgumentException(messagePrefix + VALIDATE_MILLISECOND_OVERFLOW_SUFFIX, e);
        }
    }
@Test
    public void shouldReturnMillisecondsOnValidInstant() {
        final Instant sampleInstant = Instant.now();

        assertEquals(sampleInstant.toEpochMilli(), validateMillisecondInstant(sampleInstant, "sampleInstant"));
    }