public static void removeNonDefaultRegions(Collection<RegionInfo> regions) {
    Iterator<RegionInfo> iterator = regions.iterator();
    while (iterator.hasNext()) {
      RegionInfo hri = iterator.next();
      if (!RegionReplicaUtil.isDefaultReplica(hri)) {
        iterator.remove();
      }
    }
  }
Removes the non-default replicas from the passed regions collection
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java