class HashShardManager extends ShardManager {

  @Override
  public int storeData(Data data) {
    var shardId = allocateShard(data);
    var shard = shardMap.get(shardId);
    shard.storeData(data);
    LOGGER.info(data.toString() + " is stored in Shard " + shardId);
    return shardId;
  }

  @Override
  protected int allocateShard(Data data) {<FILL_FUNCTION_BODY>}

}

    var shardCount = shardMap.size();
    var hash = data.getKey() % shardCount;
    return hash == 0 ? hash + shardCount : hash;
  
<methods>public void <init>() ,public boolean addNewShard(com.iluwatar.sharding.Shard) ,public com.iluwatar.sharding.Shard getShardById(int) ,public boolean removeShardById(int) ,public abstract int storeData(com.iluwatar.sharding.Data) <variables>protected Map<java.lang.Integer,com.iluwatar.sharding.Shard> shardMap