code: public void removeChain(ChainData inputChain) throws ChainException {
          String chainname = inputChain.getName();
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(tc, "removeChain: " + chainname);
          }
  
          if (!containsChain(chainname)) {
              ChainException e = new ChainException("Unable to find chain: " + chainname);
              FFDCFilter.processException(e, getClass().getName() + ".removeChain", "157", this, new Object[] { inputChain, this.framework });
              throw e;
          }
          // Create a chain array that is one element smaller than the current one.
          int currentLength = this.chainArray.length;
          ChainData[] newChains = new ChainData[currentLength - 1];
          // Copy all but the input chain into the new array.
          for (int i = 0; i < currentLength; i++) {
              if (!chainname.equals(this.chainArray[i].getName())) {
                  newChains[i] = this.chainArray[i];
              }
          }
          // Update this group's chain list.
          setChains(newChains);
  
          // Remove group associated listeners from the chain, only if not
          // associated with other group.
          for (ChainEventListener listener : getChainEventListeners()) {
              removeListenerFromChain(listener, inputChain);
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(tc, "removeChain");
          }
      }
docs: Removes the input chain from the group. All group chain event listeners all
  also removed from the chain unless the chain is in another group which is
  associated with the listener.
  
  @param inputChain
  chain object to be removed.
  @throws ChainException
  if chain doesn't exist in group.