BasicNodeSelectionPolicy implements INodeSelectionPolicy { @Override public List<String> remove(String shard) throws ShardAccessException { CircularList<String> nodes = _shardsToNodeMap.remove(shard); if (nodes == null) { throw new ShardAccessException(shard); } return nodes.asList(); }  void update(String shard, Collection<String> nodes); @Override Collection<String> getShardNodes(String shard); @Override List<String> remove(String shard); void removeNode(String node); Map<String, List<String>> createNode2ShardsMap(Collection<String> shards); @Override String toString();  }
@Test(expected = ShardAccessException.class) public void testRemoveNotExistingShard() throws ShardAccessException { final BasicNodeSelectionPolicy policy = new BasicNodeSelectionPolicy(); policy.remove("shardDoesNotExist"); }