public List<ShardRouting> shardsWithState(ShardRoutingState... states){
  List<ShardRouting> shards=new ArrayList<>();
  for (  ShardRouting shardEntry : this) {
    for (    ShardRoutingState state : states) {
      if (shardEntry.state() == state) {
        shards.add(shardEntry);
      }
    }
  }
  return shards;
}

public List < ShardRouting > shardsWithState ( ShardRoutingState ... states ) { List < ShardRouting > shards = new ArrayList < > ( ) ; for ( ShardRouting shardEntry : this ) { for ( ShardRoutingState state : states ) { if ( shardEntry . state ( ) == state ) { shards . add ( shardEntry ) ; } } } return shards ; }
determine the shards with a specific state
