docs: public int indexOf(E o, boolean add) {
      Integer index = indexes.get(o);
      if (index == null) {
        if (add && ! locked) {
          try {
            semaphore.acquire();
            index = indexes.get(o);
            if (index == null) {
              index = objects.size();
              objects.add(o);
              indexes.put(o, index);
            }
            semaphore.release();
          } catch (InterruptedException e) {
            throw new RuntimeException(e);
          }
        } else {
          return -1;
        }
      }
      return index;
    }