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