Query { public void addCriterion(final Criterion criterion) { this.criteria.add(criterion); }  void setQueryHint(final String queryHint); String getQueryHint(); int getPageSize(); void setPageSize(final int pageSize); int getPageNum(); void setPageNum(final int pageNum); QueryMode getQueryMode(); void setQueryMode(final QueryMode queryMode); void addCriterion(final Criterion criterion); void addCriteria(final List<Criterion> criteria); List<Criterion> getCriteria(); Criterion getCriterion(final String pojoProperty); @Deprecated(forRemoval = true, since = "v2.8.10") void setCriteria(final List<Criterion> criteria);  }
@Test public void testAddCriterion() { final List<Criterion> expected = List.of(Mockito.mock(Criterion.class), Mockito.mock(Criterion.class)); query.addCriteria(expected); final List<Criterion> criteria = query.getCriteria(); assertEquals(2, criteria.size()); assertEquals(expected.get(0), criteria.get(0)); assertEquals(expected.get(1), criteria.get(1)); }