class AbstractConditionShardLocator {

    protected boolean isAlreadyAllShards(Set<String> allShards, Set<String> shards) {
        if(shards == null || shards.isEmpty()) {
            return false;
        }
        
        if(!allShards.containsAll(shards)) {
            shards.removeAll(allShards);
            throw new IllegalStateException("Illegal shard detected:" + shards);
        }

        return allShards.equals(shards);
    }

}