code: @Override
      public synchronized ChainGroupData addChainToGroup(String groupName, String chainName) throws ChainGroupException, ChainException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "addChainToGroup chainName=" + chainName + ", groupName=" + groupName);
          }
          if (null == groupName) {
              throw new ChainGroupException("Null chain group");
          }
          if (null == chainName) {
              throw new ChainException("Null chain name");
          }
  
          // Ensure the chain exists.
          ChainData chain = this.chainDataMap.get(chainName);
          if (null == chain) {
              throw new ChainException("Unable to find chain: " + chainName);
          }
  
          // Ensure the group exists.
          ChainGroupDataImpl group = (ChainGroupDataImpl) this.chainGroups.get(groupName);
          if (null == group) {
              throw new ChainGroupException("Unable to find group: " + groupName);
          }
  
          // Add the chain to the group.
          group.addChain(chain);
  
          return group;
      }
docs: /*
  @see
  com.ibm.wsspi.channelfw.ChannelFramework#addChainToGroup(java.lang.String,
  java.lang.String)