code: private static Map<String, String> asMap(final Iterable<String> args) {
          final Map<String, String> map = new HashMap<>(0);
          final Pattern ptn = Pattern.compile("--([a-z\\-]+)(=.+)?");
          for (final String arg : args) {
              final Matcher matcher = ptn.matcher(arg);
              if (!matcher.matches()) {
                  throw new IllegalStateException(
                      String.format("can't parse this argument: '%s'", arg)
                  );
              }
              final String value = matcher.group(2);
              if (value == null) {
                  map.put(matcher.group(1), "");
              } else {
                  map.put(matcher.group(1), value.substring(1));
              }
          }
          return map;
      }
docs: Convert the provided arguments into a Map.
  @param args Arguments to parse.
  @return Map A map containing all the arguments and their values.
  @throws IllegalStateException If an argument doesn't match with the
  expected format which is {@code --([a-z\-]+)(=.+)?}.