### Question:
XDateRangeConverter implements XRangeConverter { @Override public String convertEnd(XRange xRange) { Preconditions.checkNotNull(xRange); Preconditions.checkArgument(isApplicable(xRange.getClass())); XDateRange xDateRange = (XDateRange) xRange; LocalDate endDate = xDateRange.getEndDate(); return SearchDateTimeUtils.convertDateToISOStringAtEndOfDay(endDate); }  @Override boolean isApplicable(Class<? extends XRange> clazz); @Override String convertStart(XRange xRange); @Override String convertEnd(XRange xRange); @Override String convertGap(XRange xRange);  }### Answer:
@Test public void convertEnd() { XDateRange xDateRange = new XDateRange(new LocalDate(), new LocalDate(2012, 5, 7), new Period(1, PeriodUnit.MONTH)); String endParam = xDateRangeConverter.convertEnd(xDateRange); assertEquals("2012-05-07T23:59:59Z", endParam); }
@Test(expected = NullPointerException.class) public void convertEnd_NULL_XRANGE() { xDateRangeConverter.convertEnd(null); }