protected static String[] removeKey(String[] args) {
    String[] result = null;

    if (args != null && args.length > 0) {
      // args is not empty
      // find value.
      if ((args[0].startsWith("-") && args[0].length() == 2)
          || (args[0].startsWith("--") && !args[0].contains("="))) {
        result = 1 < args.length ? Arrays.copyOfRange(args, 1, args.length)
            : null;
      } else {
        result = Arrays.copyOf(args, args.length);
        result[0] = args[0].startsWith("--") ? result[0].substring(args[0]
            .indexOf('=') + 1)
            : result[0].substring(2);
      }
    }
    
    return result;
  }