int (@NotNull String name) { int index = mySet.index(name); int id; if (index == -1) { id = mySet.size(); mySet.add(name); index = mySet.index(name); assert index != -1; if (id >= idToIndex.length) { idToIndex = ArrayUtil.realloc(idToIndex, idToIndex.length * 3 / 2); } idToIndex[id] = index; assert ArrayUtil.indexOf(idToIndex, index) == id; //noinspection AssertWithSideEffects assert toId(name) == id; } else { id = ArrayUtil.indexOf(idToIndex, index); } assert StringUtilRt.equal(fromId(id), name, true); return id; }