docs: public final static Selector getSelector() {
      synchronized (selectors) {
        Selector s = null;
        try {
          if (selectors.size() != 0) {
            s = selectors.pop();
          }
        } catch (EmptyStackException ex) {
        }
  
        int attempts = 0;
        try {
          while (s == null && attempts < 2) {
            selectors.wait(timeout);
            try {
              if (selectors.size() != 0) {
                s = selectors.pop();
              }
            } catch (EmptyStackException ex) {
              break;
            }
            attempts++;
          }
        } catch (InterruptedException ex) {
        }
        return s;
      }
    }