question: private OFFactory computeInitialFactory ( Set < OFVersion > ofVersions ) { if ( ofVersions == null || ofVersions . isEmpty ( ) ) { throw new IllegalStateException ( "OpenFlow version list should never be null or empty at this point. Make sure it's set in the OFSwitchManager." ) ; } OFVersion highest = null ; for ( OFVersion v : ofVersions ) { if ( highest == null ) { highest = v ; } else if ( v . compareTo ( highest ) > 0 ) { highest = v ; } } return OFFactories . getFactory ( highest ) ; }
target:  Find the max version supplied in the supported versions list and use it as the default, which will subsequently be used in our hello message header's version field. The factory can be later "downgraded" to a lower version depending on what's computed during the version-negotiation part of the handshake. Assumption: The Set of OFVersion ofVersions variable has been set already and is NOT EMPTY.