@Override
    public int compare(final Reader reader1, final Reader reader2) {
      int id1 = reader1.getUniqueId();
      int id2 = reader2.getUniqueId();
      LogEntry entry1 = reader1.peek();
      LogEntry entry2 = reader2.peek();
      if (entry1 == null) {
        if (entry2 == null) {
          return Integer.compare(id1, id2);
        }
        // sort readers with no entries before readers with entries so they'll
        // be removed quickly
        return -1;
      }
      if (entry2 == null) {
        return 1;
      }
      String timestamp1 = entry1.getTimestamp();
      String timestamp2 = entry2.getTimestamp();
      int compare = timestamp1.compareTo(timestamp2);
      if (compare == 0) {
        if (id1 < id2) {
          return -1;
        }
        return 1;
      }
      return compare;
    }
Merges the log files from a given set of {@code InputStream}s into a
{@code PrintWriter}.

@param logFiles The log files to be merged
@param mergedFile Where the merged logs are printed to
@param tabOut Whether to align non-timestamped lines with others
@param suppressBlanks Whether to suppress output of blank lines

@return Whether or not problems occurred while merging the log files.

@throws IllegalArgumentException If the length of {@code logFiles} is not the same as
        the length of {@code logFileNames}
geode-core/src/main/java/org/apache/geode/internal/logging/MergeLogFiles.java