private static Endpoint selectFirstConnected ( final List < Endpoint > endpoints ) { for ( Endpoint endpoint : endpoints ) { if ( endpoint . isState ( LifecycleState . CONNECTED ) && endpoint . isFree ( ) ) { return endpoint ; } } return null ; }
Helper method to select the first connected endpoint if no particular pinning is needed .