public boolean addNewShard(final Shard shard) {
    var shardId = shard.getId();
    if (!shardMap.containsKey(shardId)) {
      shardMap.put(shardId, shard);
      return true;
    } else {
      return false;
    }
  }
@Test
  void testAddNewShard() {
    try {
      var shard = new Shard(1);
      shardManager.addNewShard(shard);
      var field = ShardManager.class.getDeclaredField("shardMap");
      field.setAccessible(true);
      var map = (Map<Integer, Shard>) field.get(shardManager);
      assertEquals(1, map.size());
      assertEquals(shard, map.get(1));
    } catch (NoSuchFieldException | IllegalAccessException e) {
      fail("Fail to modify field access.");
    }
  }