public void forAny ( Consumer < RouterStub > action ) { while ( ! stubs . isEmpty ( ) ) { RouterStub stub = Util . pickRandomElement ( stubs ) ; if ( stub != null && stub . isConnected ( ) ) { action . accept ( stub ) ; return ; } } }
Applies action to a randomly picked RouterStub that s connected