code: public static DateTimeComparator getInstance(DateTimeFieldType lowerLimit, DateTimeFieldType upperLimit) {
          if (lowerLimit == null && upperLimit == null) {
              return ALL_INSTANCE;
          }
          if (lowerLimit == DateTimeFieldType.dayOfYear() && upperLimit == null) {
              return DATE_INSTANCE;
          }
          if (lowerLimit == null && upperLimit == DateTimeFieldType.dayOfYear()) {
              return TIME_INSTANCE;
          }
          return new DateTimeComparator(lowerLimit, upperLimit);
      }
docs: Returns a DateTimeComparator with a lower and upper limit. Fields of a
  magnitude less than the lower limit are excluded from comparisons.
  Fields of a magnitude greater than or equal to the upper limit are also
  excluded from comparisons. Either limit may be specified as null, which
  indicates an unbounded limit.
  <p>
  The time-zone is considered when using this comparator unless both limits are null.
  The input millis are rounded/truncated using the time-zone of that input value.
  Thus, two inputs with different time-zones will typically not be equal
  
  @param lowerLimit  inclusive lower limit for fields to be compared, null means no limit
  @param upperLimit  exclusive upper limit for fields to be compared, null means no limit
  @return a comparator over all fields between the limits