### Question:
FindAllDmnAssetsQuery extends AbstractFindQuery implements NamedQuery { @Override public void validateTerms(final Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkTerms(queryTerms, NAME, requiredTermNames(), repositoryRootIndexTermPredicate(), fileExtensionIndexTermPredicate()); checkTermsSize(2, queryTerms); } @Inject  FindAllDmnAssetsQuery(final FileDetailsResponseBuilder responseBuilder); @Override String getName(); @Override Query toQuery(final Set<ValueIndexTerm> terms); @Override Sort getSortOrder(); @Override ResponseBuilder getResponseBuilder(); @Override void validateTerms(final Set<ValueIndexTerm> queryTerms); static String NAME; }### Answer:
@Test public void testValidateTerms() { final Set<ValueIndexTerm> queryTerms = new HashSet<>(); final String[] requiredTermNames = new String[]{}; final Predicate<ValueIndexTerm> fileExtensionIndexTermPredicate = (t) -> true; final Predicate<ValueIndexTerm> repositoryRootIndexTermPredicate = (t) -> true; doReturn(requiredTermNames).when(query).requiredTermNames(); doReturn(fileExtensionIndexTermPredicate).when(query).repositoryRootIndexTermPredicate(); doReturn(repositoryRootIndexTermPredicate).when(query).fileExtensionIndexTermPredicate(); query.validateTerms(queryTerms); verify(query).checkTermsSize(2, queryTerms); verify(query).checkTerms(queryTerms, NAME, requiredTermNames, fileExtensionIndexTermPredicate, repositoryRootIndexTermPredicate); }