public int compare(OffsetDateTime datetime1, OffsetDateTime datetime2) {

      // int cmp = Jdk7Methods.Long_compare(datetime1.toEpochSecond(), datetime2.toEpochSecond());
      long x = datetime1.toEpochSecond();
      long y = datetime2.toEpochSecond();
      int cmp = (x < y) ? -1 : ((x == y) ? 0 : 1);

      if (cmp == 0) {
        // cmp = Jdk7Methods.Long_compare(datetime1.getTime().toNanoOfDay(),
        // datetime2.getTime().toNanoOfDay());
        long x2 = datetime1.getTime().toNanoOfDay();
        long y2 = datetime2.getTime().toNanoOfDay();
        cmp = (x2 < y2) ? -1 : ((x2 == y2) ? 0 : 1);
      }
      return cmp;
    }