class DateUtil {

    public static Instant snapToSeconds(Instant date, int seconds) {
        notNull(date, "date can't be null");
        Instant instantSnapToSeconds = truncatedToSeconds(date);
        long remainder = instantSnapToSeconds.getEpochSecond() % seconds;
        return truncatedToSeconds(date.minusSeconds(remainder));
    }

}