// Path: greencoffee/src/main/java/com/mauriciotogneri/greencoffee/exceptions/InvalidMethodSignatureException.java
// public class InvalidMethodSignatureException extends RuntimeException
// {
//     public InvalidMethodSignatureException(Method method, String pattern, String text)
//     {
//         super(String.format("Invalid number of type of parameters%n%nClass: %s%nMethod: %s%nPattern: \"%s\"%nText matched: \"%s\"%n", method.getDeclaringClass().getSimpleName(), method.getName(), pattern, text));
//     }
// }
// 
// Path: greencoffee/src/main/java/com/mauriciotogneri/greencoffee/exceptions/StepFailureException.java
// public class StepFailureException extends RuntimeException
// {
//     public StepFailureException(Method method, String pattern, String text, String cause)
//     {
//         super(String.format("Error processing step%n%nClass: %s%nMethod: %s%nPattern: \"%s\"%nText matched: \"%s\"%n%n%s", method.getDeclaringClass().getSimpleName(), method.getName(), pattern, text, cause));
//     }
// }


import com.mauriciotogneri.greencoffee.exceptions.InvalidMethodSignatureException;
import com.mauriciotogneri.greencoffee.exceptions.StepFailureException;
import java.lang.reflect.Method;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gherkin.ast.DataTable;
import gherkin.ast.DocString;
import gherkin.ast.Node;
        Matcher matcher = pattern.matcher(text);

        return matcher.find();
    }

    void invoke(String text, Node argument)
    {
        Matcher matcher = pattern.matcher(text);

        if (matcher.find())
        {
            Object[] parameters;

            try
            {
                parameters = parameters(matcher, argument);
            }
            catch (Exception e)
            {
                throw new InvalidMethodSignatureException(method, pattern.pattern(), text);
            }

            try
            {
                method.invoke(target, parameters);
            }
            catch (Exception e)
            {
                Throwable cause = e.getCause();

// Path: greencoffee/src/main/java/com/mauriciotogneri/greencoffee/exceptions/InvalidMethodSignatureException.java
// public class InvalidMethodSignatureException extends RuntimeException
// {
//     public InvalidMethodSignatureException(Method method, String pattern, String text)
//     {
//         super(String.format("Invalid number of type of parameters%n%nClass: %s%nMethod: %s%nPattern: \"%s\"%nText matched: \"%s\"%n", method.getDeclaringClass().getSimpleName(), method.getName(), pattern, text));
//     }
// }
// 
// Path: greencoffee/src/main/java/com/mauriciotogneri/greencoffee/exceptions/StepFailureException.java
// public class StepFailureException extends RuntimeException
// {
//     public StepFailureException(Method method, String pattern, String text, String cause)
//     {
//         super(String.format("Error processing step%n%nClass: %s%nMethod: %s%nPattern: \"%s\"%nText matched: \"%s\"%n%n%s", method.getDeclaringClass().getSimpleName(), method.getName(), pattern, text, cause));
//     }
// }


// Path: greencoffee/src/main/java/com/mauriciotogneri/greencoffee/StepDefinition.java
import com.mauriciotogneri.greencoffee.exceptions.InvalidMethodSignatureException;
import com.mauriciotogneri.greencoffee.exceptions.StepFailureException;
import java.lang.reflect.Method;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gherkin.ast.DataTable;
import gherkin.ast.DocString;
import gherkin.ast.Node;

        Matcher matcher = pattern.matcher(text);

        return matcher.find();
    }

    void invoke(String text, Node argument)
    {
        Matcher matcher = pattern.matcher(text);

        if (matcher.find())
        {
            Object[] parameters;

            try
            {
                parameters = parameters(matcher, argument);
            }
            catch (Exception e)
            {
                throw new InvalidMethodSignatureException(method, pattern.pattern(), text);
            }

            try
            {
                method.invoke(target, parameters);
            }
            catch (Exception e)
            {
                Throwable cause = e.getCause();

                throw new StepFailureException(method, pattern.pattern(), text, (cause != null) ? cause.toString() : e.toString());