public RegionLocations remove(int replicaId) {
    if (getRegionLocation(replicaId) == null) {
      return this;
    }

    HRegionLocation[] newLocations = new HRegionLocation[locations.length];

    System.arraycopy(locations, 0, newLocations, 0, locations.length);
    if (replicaId < newLocations.length) {
      newLocations[replicaId] = null;
    }

    return new RegionLocations(newLocations);
  }
Removes location of the given replicaId from the list
@param replicaId the replicaId of the location to remove
@return an RegionLocations object with removed locations or the same object if nothing is
        removed
hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLocations.java