code: private int getId(int value) throws PaletteFullException {
          short id = idLookup.get(value);
          if (!idLookup.isEmptyValue(id)) {
              return id;
          } else {
              id = (short) paletteCounter.getAndIncrement();
              if (id >= paletteSize) {
                  throw new PaletteFullException();
              }
              short oldId = idLookup.putIfAbsent(value, id);
              if (!idLookup.isEmptyValue(oldId)) {
                  id = oldId;
              }
              palette.set(id, value);
              return id;
          }
      }
docs: Gets the id for the given value, allocating an id if required
  
  @return the id