code: public synchronized int addElement(E theElement) {
          if (theElement == null) {
              return -1;
          }
          if (elementCount == currentCapacity) {
              // try to expand the table to handle the new value, if that fails
              // then it will throw an illegalstate exception
              expandTable();
          }
          int theIndex = occupiedSlots.nextClearBit(0);
          if (theIndex < 0 || theIndex > currentCapacity - 1) {
              throw new IllegalStateException("No space available for element");
          }
          theElementArray[theIndex] = theElement;
          elementCount++;
          occupiedSlots.set(theIndex);
          return theIndex;
      }
docs: Add an element to the LookupTable. Returns the index value which can be
  used to look up the element in the LookupTable.
  
  @param theElement
  the object to add to the LookupTable. Should not be null.
  @return an int holding the Index value which points to the object in the
  LookupTable. -1 if theElement is null.