AstToMongoDBQuery { Criteria chainCriteriaByOrOperator(List<Criteria> criteriaList) { Criteria[] criteriaArray = criteriaList.toArray(Criteria[]::new); if (criteriaArray.length == 0) { throw new PartialEvauationException("The Open Policy Agent partial evaluation has returned an empty result"); } else if (criteriaArray.length == 1) { return criteriaArray[0]; } else { Criteria criteria = new Criteria(); criteria.orOperator(criteriaArray); return criteria; } } AstToMongoDBQuery(OpaCompilerResponse opaCompilerResponse); Query createQuery();  }
@Test void shouldThrowPartialEvaluationException() { assertThrows(PartialEvauationException.class, () -> target.chainCriteriaByOrOperator(Collections.emptyList())); }