@VisibleForTesting
  public <T> T lookup(Class<T> clazz, Object key) {
    List<T> all = lookupAll(clazz, key);
    if (all.size() != 1) {
      // FIXME: use a different exception type?
      throw new IllegalArgumentException("Expected match count is 1; but got:" + all);
    }
    return all.get(0);
  }
Links and optionally merges the groups identified by the two objects.
ql/src/java/org/apache/hadoop/hive/ql/plan/mapper/PlanMapper.java