public static int findEndSignal(
        final List<Token> tokens, final int index, final Signal signal, final String name)
    {
        int result = tokens.size() - 1;

        for (int i = index, endIndex = tokens.size() - 1; i < endIndex; i++)
        {
            final Token token = tokens.get(i);

            if (signal == token.signal() && name.equals(token.name()))
            {
                result = i;
                break;
            }
        }

        return result;
    }
Find the index of the end signal for a given name.

@param tokens to search.
@param index  to start from.
@param signal to match.
@param name   to match.
@return index where found.
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/GenerationUtil.java