code: public void remove(Symbol sym) {
              Assert.check(shared == 0);
              Entry e = lookup(sym.name, candidate -> candidate == sym);
              if (e.scope == null) return;
  
              // remove e from table and shadowed list;
              int i = getIndex(sym.name);
              Entry te = table[i];
              if (te == e)
                  table[i] = e.shadowed;
              else while (true) {
                  if (te.shadowed == e) {
                      te.shadowed = e.shadowed;
                      break;
                  }
                  te = te.shadowed;
              }
  
              // remove e from elems and sibling list
              te = elems;
              if (te == e)
                  elems = e.sibling;
              else while (true) {
                  if (te.sibling == e) {
                      te.sibling = e.sibling;
                      break;
                  }
                  te = te.sibling;
              }
  
              removeCount++;
  
              //notify listeners
              listeners.symbolRemoved(sym, this);
          }
docs: Remove symbol from this scope.