code: private <T extends Comparable<T>> int compareToLinear(int currentResult, T thisValue, T otherValue, VersionIdentifier otherVersion) {
  
      if (currentResult == COMPARE_TO_INCOMPARABLE) {
        return COMPARE_TO_INCOMPARABLE;
      }
      int result = currentResult;
      if (thisValue != null) {
        if (otherValue != null) {
          int diff = thisValue.compareTo(otherValue);
          if (result == 0) {
            if ((diff != 0) && (!isSnapshot()) && (!otherVersion.isSnapshot())) {
              return COMPARE_TO_INCOMPARABLE;
            }
            if (diff < 0) {
              result = COMPARE_TO_STRICT_PREDECESSOR;
            } else {
              result = COMPARE_TO_STRICT_SUCCESSOR;
            }
          } else if (result < 0) {
            // this.timestamp < otherVersion.timestamp
            if (diff > 0) {
              return COMPARE_TO_INCOMPARABLE;
            }
          } else {
            // this.timestamp > otherVersion.timestamp
            if (diff < 0) {
              return COMPARE_TO_INCOMPARABLE;
            }
          }
        }
      }
      return result;
    }
docs: This method performs the part of {@link #compareTo(VersionIdentifier)} for linear and optional attributes
  like {@link #getTimestamp()} or {@link #getRevision()}.
  
  @param <T> is the generic type of the {@link Comparable} value.
  @param currentResult is the current result so far.
  @param thisValue is the value of this {@link VersionIdentifier}.
  @param otherValue is the value of the other {@link VersionIdentifier}.
  @param otherVersion is the {@link VersionIdentifier} to compare to.
  @return the result of comparison.