code: public final int compareTo(final Period arg0) {
          // Throws documented exception if type is wrong or parameter is null
          if (arg0 == null) {
              throw new ClassCastException("Cannot compare this object to null");
          }
          final int startCompare = getStart().compareTo(arg0.getStart());
          if (startCompare != 0) {
              return startCompare;
          }
          // start dates are equal, compare end dates..
          else if (duration == null) {
              final int endCompare = getEnd().compareTo(arg0.getEnd());
              if (endCompare != 0) {
                  return endCompare;
              }
          }
          // ..or durations
          return new TemporalAmountComparator().compare(getDuration(), arg0.getDuration());
      }
docs: Compares the specified period with this period.
  First, compare the start dates.  If they are the same, compare the end dates.
  
  @param arg0 a period to compare with this one
  @return a postive value if this period is greater, negative if the other is
  greater, or zero if they are equal