static ResourceMethodConfigElement parse(RestLiMethodConfig.ConfigType configType, String key, Object value)
          throws ResourceMethodConfigParsingException
  {
    ParsingErrorListener errorListener = new ParsingErrorListener();
    ANTLRInputStream input = new ANTLRInputStream(key);
    ResourceMethodKeyLexer lexer = new ResourceMethodKeyLexer(input);
    lexer.removeErrorListeners();
    lexer.addErrorListener(errorListener);
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    ResourceMethodKeyParser parser = new ResourceMethodKeyParser(tokens);
    parser.removeErrorListeners();
    parser.addErrorListener(errorListener);
    ResourceMethodKeyParser.KeyContext keyTree = parser.key();

    if (!errorListener.hasErrors())
    {
      Optional<String> resourceName = handlingWildcard(keyTree.restResource());
      Optional<ResourceMethod> opType = getOpType(keyTree.operation());
      Optional<String> opName = opType.flatMap(method -> getOpName(method, keyTree.operation()));
      return new ResourceMethodConfigElement(key, coerceValue(configType, value), configType, resourceName, opType, opName);
    }
    else
    {
      throw new ResourceMethodConfigParsingException(
              "Error" + ((errorListener.errorsSize() > 1) ? "s" : "") + " parsing key: " + key + "\n" + errorListener);
    }
  }
@Test(dataProvider = "invalidConfigs", expectedExceptions = {ResourceMethodConfigParsingException.class})
  public void testInvalidTimeoutConfigParsing(RestLiMethodConfig.ConfigType configType,
                                              String configKey,
                                              Object configValue) throws ResourceMethodConfigParsingException
  {
    ResourceMethodConfigElement.parse(configType, configKey, configValue);
  }