code: protected static Map<String, String> initializeSystemProperties(final String[] args) {
          final Map<String, String> result = new HashMap<>();
          final Pattern pattern = Pattern.compile("-D(.+)=(.+)");
          for (final String arg : args) {
              final Matcher matcher = pattern.matcher(arg);
              if (matcher.matches()) {
                  final String key = matcher.group(1);
                  final String value = matcher.group(2);
                  result.put(key, value);
                  System.setProperty(key, value);
              }
          }
          return result;
      }
docs: Initializes system properties based on the arguments passed
  
  @param args
  @return