public @ Nonnull ThreadType onlyThread ( ) throws IllegalStateException { if ( size ( ) != 1 ) throw new IllegalStateException ( "Exactly one thread expected in the set. Found " + size ( ) ) ; return threads . iterator ( ) . next ( ) ; }
Extract the only thread from set .