### Question:
ShardManager { public boolean removeShardById(final int shardId) { if (shardMap.containsKey(shardId)) { shardMap.remove(shardId); return true; } else { return false; } } ShardManager(); boolean addNewShard(final Shard shard); boolean removeShardById(final int shardId); Shard getShardById(final int shardId); abstract int storeData(final Data data);  }### Answer:
@Test public 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); Assert.assertEquals(true, flag); Assert.assertEquals(0, map.size()); } catch (IllegalAccessException | NoSuchFieldException e) { Assert.fail("Fail to modify field access."); } }