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