class DateRangeAndType {

  public static DateRangeAndType fromString(final String dateRange) {
    Preconditions.checkNotNull(dateRange, "DateRange cannot be null.");
    Preconditions.checkArgument(!dateRange.isEmpty(), "DateRange cannot be empty.");

    return dateRange.contains(",") ? parseCustomFormat(dateRange) : parseEnumFormat(dateRange);
  }

}

class DateRangeAndTypeTest {

  private LocalDate date;

  @Test(expected = IllegalArgumentException.class)
  public void testEmptyRange() {

    DateRangeAndType.fromString("");
  }

}