@Test public void shouldPushTokenAtBegining() { Token pushedToken = new Token("push", 1, 0); List<Token> pushedTokenList = new ArrayList<>(); pushedTokenList.add(pushedToken); tokenQueue.pushForward(pushedTokenList); assertThat(tokenQueue.peek(), is(pushedToken)); assertThat(tokenQueue.size(), is(4)); }
@Test public void shouldPollToken() { Token token = tokenQueue.poll(); assertThat(token, is(new Token("a", 1, 0))); assertThat(tokenQueue.size(), is(2)); }
@Test public void shouldPeekToken() { Token token = tokenQueue.peek(); assertThat(token, is(new Token("a", 1, 0))); assertThat(tokenQueue.size(), is(3)); }