class UnderReplicatedBlocks implements Iterable<Block> {

  boolean add(BlockInfoContiguous block, int curReplicas, int decomissionedReplicas,
      int expectedReplicas)
      throws StorageException, TransactionContextException {
    assert curReplicas >= 0 : "Negative replicas!";
    int priLevel = getPriority(block, curReplicas, decomissionedReplicas,
                               expectedReplicas);
    if(add(block, priLevel, expectedReplicas)) {
      NameNode.blockStateChangeLog.debug(
          "BLOCK* NameSystem.UnderReplicationBlock.add: {}"
              + " has only {} replicas and need {} replicas so is added to" +
              " neededReplications at priority level {}", block, curReplicas,
          expectedReplicas, priLevel);
      return true;
    }
    return false;
  }

    UnderReplicatedBlocks();

}