static Selector newSelector(ILogger logger) {
        checkNotNull(logger, "logger");

        Selector selector;
        try {
            selector = Selector.open();
        } catch (IOException e) {
            throw new HazelcastException("Failed to open a Selector", e);
        }

        boolean optimize = Boolean.parseBoolean(System.getProperty("hazelcast.io.optimizeselector", "true"));
        if (optimize) {
            optimize(selector, logger);
        }
        return selector;
    }
static Selector newSelector ( ILogger logger ) { checkNotNull ( logger , "logger" ) ; Selector selector ; try { selector = Selector . open ( ) ; } catch ( IOException e ) { throw new HazelcastException ( "Failed to open a Selector" , e ) ; } boolean optimize = Boolean . parseBoolean ( System . getProperty ( "hazelcast.io.optimizeselector" , "true" ) ) ; if ( optimize ) { optimize ( selector , logger ) ; } return selector ; }
Creates a new Selector and will optimize it if possible.

@param logger the logger used for the optimization process.
@return the created Selector.
@throws NullPointerException if logger is null.