code: boolean isStale(long[] newVersions, int replicaIndex) {
          int index = replicaIndex - 1;
          long currentVersion = versions[index];
          long newVersion = newVersions[index];
          return currentVersion > newVersion;
      }
docs: Returns whether given replica version is behind the current version or not.
  @param newVersions new replica versions
  @param replicaIndex replica index
  @return true if given version is stale, false otherwise