@Override
  public boolean matchToken(TokenQueue tokenQueue, List<Token> matchedTokenList) {
    if (!tokenQueue.isNextTokenValue(lToken)) {
      return false;
    }
    int stack = 0;
    while (tokenQueue.peek() != null) {
      Token token = tokenQueue.poll();
      if (lToken.equals(token.getValue())) {
        stack++;
      } else if (rToken.equals(token.getValue())) {
        stack--;
      }
      matchedTokenList.add(token);
      if (stack == 0) {
        return true;
      }
    }
    return false;
  }
@Test
  public void shouldNotMatchWhenNoRight() {
    Token t1 = new Token("(", 1, 1);
    TokenQueue tokenQueue = spy(new TokenQueue(Arrays.asList(t1)));
    List<Token> output = mock(List.class);
    BridgeTokenMatcher matcher = new BridgeTokenMatcher("(", ")");

    assertThat(matcher.matchToken(tokenQueue, output), is(false));
    verify(tokenQueue, times(1)).isNextTokenValue("(");
    verify(tokenQueue, times(1)).poll();
    verify(tokenQueue, times(2)).peek();
    verifyNoMoreInteractions(tokenQueue);
    verify(output).add(t1);
    verifyNoMoreInteractions(output);
  }