### Question:
DateTimeService { public ZonedDateTime getEndingTimestampOfMonthUTC(ZonedDateTime zonedDateTime) { ZonedDateTime zonedDateTimeToConvert = zonedDateTime; zonedDateTimeToConvert = zonedDateTimeToConvert.toInstant().atZone(ZoneId.of("UTC")); zonedDateTimeToConvert = zonedDateTimeToConvert.plus(1, ChronoUnit.MONTHS); zonedDateTimeToConvert = zonedDateTimeToConvert.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0); zonedDateTimeToConvert = zonedDateTimeToConvert.minus(1, ChronoUnit.SECONDS); return zonedDateTimeToConvert; }  ZonedDateTime getFutureDate(ZonedDateTime timestamp, int numberOfDays, boolean endOfDay); ZonedDateTime getDateTimeNowEurope(); ZonedDateTime getDateTimeNowUTC(); ZonedDateTime getBeginningTimestampOfMonthUTC(final ZonedDateTime zonedDateTime); ZonedDateTime getEndingTimestampOfMonthUTC(ZonedDateTime zonedDateTime); ZonedDateTime getBeginningTimestampOfWeekUTC(ZonedDateTime zonedDateTime); ZonedDateTime getEndingTimestampOfWeekUTC(ZonedDateTime zonedDateTime); ZonedDateTime getBeginningTimestampOfDayUTC(ZonedDateTime zonedDateTime); ZonedDateTime getEndingTimestampOfDayUTC(ZonedDateTime zonedDateTime); ZonedDateTime convertDateToZonedDateTimeEurope(Date date); ZonedDateTime getBeginningOfCurrentYear(); ZonedDateTime getEndingOfCurrentYear(); String getMonthNameFor(ZonedDateTime dateTime);  }### Answer:
@Test public void getEndingTimestampOfMonth() throws Exception { DateTimeService cut = new DateTimeService(); ZonedDateTime expected = ZonedDateTime.now(ZoneId.of("UTC")).withYear(2017).withMonth(4).withDayOfMonth(30).withHour(23).withMinute(59).withSecond(59).withNano(0); ZonedDateTime current = ZonedDateTime.of(2017, 4, 8, 12, 23, 45, 800, ZoneId.of("UTC")); assertThat(cut.getEndingTimestampOfMonthUTC(current), is(expected)); }
@Test public void getEndingTimestampOfMonthUTC() throws Exception { DateTimeService cut = new DateTimeService(); ZonedDateTime expected = ZonedDateTime.now(ZoneId.of("UTC")).withYear(2017).withMonth(5).withDayOfMonth(31).withHour(23).withMinute(59).withSecond(59).withNano(0); ZonedDateTime current = ZonedDateTime.of(2017, 5, 29, 12, 23, 45, 800, ZoneId.of("UTC")); assertThat(cut.getEndingTimestampOfMonthUTC(current), is(expected)); }