code: private boolean applyNewPartitionTable(PartitionReplica[][] partitionTable,
              int newVersion, Collection<MigrationInfo> completedMigrations, Address sender) {
          try {
              if (!lock.tryLock(PTABLE_SYNC_TIMEOUT_SECONDS, SECONDS)) {
                  return false;
              }
          } catch (InterruptedException e) {
              Thread.currentThread().interrupt();
              return false;
          }
  
          try {
              int currentVersion = partitionStateManager.getVersion();
              if (newVersion < currentVersion) {
                  if (logger.isFineEnabled()) {
                      logger.fine("Already applied partition state change. Local version: " + currentVersion
                              + ", Master version: " + newVersion + " Master: " + sender);
                  }
                  return false;
              } else if (newVersion == currentVersion) {
                  if (logger.isFineEnabled()) {
                      logger.fine("Already applied partition state change. Version: " + currentVersion + ", Master: " + sender);
                  }
                  return true;
              }
  
              requestMemberListUpdateIfUnknownMembersFound(sender, partitionTable);
              updatePartitionsAndFinalizeMigrations(partitionTable, newVersion, completedMigrations);
              return true;
          } finally {
              lock.unlock();
          }
      }
docs: Applies the {@code partitionState} sent by the {@code sender} if the new state is newer than the current one
  and finalizes the migrations.
  This method does not validate the sender. It is caller method's responsibility.
  This method will acquire the partition service lock.
  
  @param partitionTable the new partition table
  @param newVersion new partition state version
  @param completedMigrations latest completed migrations
  @param sender         the sender of the new partition state
  @return {@code true} if the partition state version is higher than the current one and was applied or
  if the partition state version is same as the current one