docs: private static Ref removeCompanionOpt(List<Ref> refs, Ref cmp) {
          Iterator<Ref> iter;
          Ref ref;
  
          iter = refs.iterator();
          while (iter.hasNext()) {
              ref = iter.next();
              if (ref.module.equals(cmp.module) && Util.eq(ref.variant, cmp.variant)) {
                  iter.remove();
                  return ref;
              }
          }
          return null;
      }