class BusinessObjectDataHelper {

    public void validateRegistrationDateRangeFilter(RegistrationDateRangeFilter registrationDateRangeFilter)
    {
        Assert.isTrue(registrationDateRangeFilter.getStartRegistrationDate() != null || registrationDateRangeFilter.getEndRegistrationDate() != null,
            "Either start registration date or end registration date must be specified.");

        if (registrationDateRangeFilter.getStartRegistrationDate() != null && registrationDateRangeFilter.getEndRegistrationDate() != null)
        {
            Assert.isTrue(registrationDateRangeFilter.getStartRegistrationDate().compare(registrationDateRangeFilter.getEndRegistrationDate()) <= 0, String
                .format("The start registration date \"%s\" cannot be greater than the end registration date \"%s\".",
                    registrationDateRangeFilter.getStartRegistrationDate(), registrationDateRangeFilter.getEndRegistrationDate()));
        }
    }

}