public static List<Long> getIds(final Map<Long, String> qcIdNames,
                                   final List<String> qcNames)
   {
      List<Long> ids = new ArrayList<Long>();
      List<String> qcNameCopies = new ArrayList<String>();
      qcNameCopies.addAll(qcNames);
      for (Map.Entry<Long, String> me : qcIdNames.entrySet()) {
         String qcName = me.getValue();
         if (qcNameCopies.contains(qcName)) {
            if (qcNameCopies.remove(qcName)) {
               ids.add(me.getKey());
            }
         }
         if (qcNameCopies.isEmpty()) {
            break;
         }
      }
      return (!ids.isEmpty() ? ids : null);
   }