code: public Config find(String morphlineId, Config config, String nameForErrorMsg) {
      List<? extends Config> morphlineConfigs = config.getConfigList("morphlines");
      if (morphlineConfigs.size() == 0) {
        throw new MorphlineCompilationException(
            "Morphline file must contain at least one morphline: " + nameForErrorMsg, null);
      }
      if (morphlineId != null) {
        morphlineId = morphlineId.trim();
      }
      if (morphlineId != null && morphlineId.length() == 0) {
        morphlineId = null;
      }
      Config morphlineConfig = null;
      if (morphlineId == null) {
        morphlineConfig = morphlineConfigs.get(0);
        Preconditions.checkNotNull(morphlineConfig);
      } else {
        for (Config candidate : morphlineConfigs) {
          if (morphlineId.equals(new Configs().getString(candidate, "id", null))) {
            morphlineConfig = candidate;
            break;
          }
        }
        if (morphlineConfig == null) {
          throw new MorphlineCompilationException(
              "Morphline id '" + morphlineId + "' not found in morphline file: " + nameForErrorMsg, null);
        }
      }
      return morphlineConfig; 
    }
docs: Finds the given morphline id within the given morphline config, using the given nameForErrorMsg
  for error reporting.