### Question:
Parser { public static <T> MinijaxCriteriaQuery<T> parse(final MinijaxCriteriaBuilder cb, final Class<T> resultType, final List<Token> tokens) { return new Parser<>(cb, resultType, tokens).parse(); } private  Parser(final MinijaxCriteriaBuilder cb, final Class<T> resultType, final List<Token> tokens); static MinijaxCriteriaQuery<T> parse(final MinijaxCriteriaBuilder cb, final Class<T> resultType, final List<Token> tokens);  }### Answer:
@Test public void testParseSelectConjunction() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE id = :id AND name = :name")); assertNotNull(query); }
@Test public void testParseSelectDisjunction() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE id = :id OR name = :name")); assertNotNull(query); }
@Test public void testParseEqualsNamedVariable() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE w.name = :names")); assertNotNull(query); }
@Test public void testParseIsNull() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE w.name IS NULL")); assertNotNull(query); }
@Test public void testParseIsNotNull() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE w.name IS NOT NULL")); assertNotNull(query); }
@Test public void testParseIn() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE w.name IN('foo', 'bar')")); assertNotNull(query); }
@Test public void testParseInNamedVariable() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w WHERE w.name IN :names")); assertNotNull(query); }
@Test public void testParseOrderByAsc() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w ORDER BY w.name ASC")); assertNotNull(query); }
@Test public void testParseOrderByDesc() { final MinijaxCriteriaQuery<Widget> query = Parser.parse( em.getCriteriaBuilder(), Widget.class, Tokenizer.tokenize("SELECT w FROM Widget w ORDER BY w.name DESC")); assertNotNull(query); }