code: private static Map<String, String> buildMap(final Collection<String> lines) throws IllegalArgumentException
      {
          final Map<String, String> map;
  
          if (lines == null)
          {
              throw new IllegalArgumentException("Environment must not be null.");
          }
  
          map = new HashMap<>();
  
          for (String line : lines)
          {
              int colonPosition;
              String key;
              String value;
  
              colonPosition = line.indexOf(':');
  
              // no colon on the line?
              if (colonPosition < 0)
              {
                  continue;
              }
  
              // key doesn't start with agi_ or ogi_?
              if (!line.startsWith("agi_") && !line.startsWith("ogi_"))
              {
                  continue;
              }
  
              // first colon in line is last character -> no value present?
              if (line.length() < colonPosition + 2)
              {
                  continue;
              }
  
              key = line.substring(4, colonPosition).toLowerCase(Locale.ENGLISH);
              value = line.substring(colonPosition + 2);
  
              if (value.length() != 0)
              {
                  map.put(key, value);
              }
          }
  
          return map;
      }
docs: Builds a map containing variable names as key (with the "agi_" or "ogi_"
  prefix stripped) and the corresponding values.
  <p>
  Syntactically invalid and empty variables are skipped.
  
  @param lines the environment to transform.
  @return a map with the variables set corresponding to the given
  environment.
  @throws IllegalArgumentException if lines is <code>null</code>