public static boolean isReplicasForSameRegion(RegionInfo regionInfoA, RegionInfo regionInfoB) {
    return compareRegionInfosWithoutReplicaId(regionInfoA, regionInfoB) == 0;
  }
Removes the non-default replicas from the passed regions collection
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java