public int numberOfShardsWithState(ShardRoutingState... states){
  int count=0;
  for (  ShardRouting shardEntry : this) {
    for (    ShardRoutingState state : states) {
      if (shardEntry.state() == state) {
        count++;
      }
    }
  }
  return count;
}

public int numberOfShardsWithState ( ShardRoutingState ... states ) { int count = 0 ; for ( ShardRouting shardEntry : this ) { for ( ShardRoutingState state : states ) { if ( shardEntry . state ( ) == state ) { count ++ ; } } } return count ; }
determine the number of shards with a specific state
