### Question:
FindPackageNamesQuery extends AbstractFindQuery implements NamedQuery { @Override public void validateTerms(Set<ValueIndexTerm> queryTerms) { checkNotNullAndNotEmpty(queryTerms); checkInvalidAndRequiredTerms(queryTerms, NAME, new String[]{ null, packageNameIndexTerm.getTerm() }, (t) -> (t instanceof ValueModuleRootPathIndexTerm), (t) -> (Objects.equals(t.getTerm(), packageNameIndexTerm.getTerm()))); }  @Override String getName(); @Override ResponseBuilder getResponseBuilder(); @Override Query toQuery(Set<ValueIndexTerm> terms); @Override void validateTerms(Set<ValueIndexTerm> queryTerms); static final String NAME; }### Answer:
@Test(expected = IllegalArgumentException.class) public void testValidateTermsNoTerms() { new FindPackageNamesQuery().validateTerms(new HashSet<>()); }
@Test(expected = IllegalArgumentException.class) public void testValidateTermsNoPackageNameIndexTerm() { final HashSet<ValueIndexTerm> queryTerms = new HashSet<>(); queryTerms.add(new ValueModuleRootPathIndexTerm()); new FindPackageNamesQuery().validateTerms(queryTerms); }
@Test public void testValidateTerms() { final HashSet<ValueIndexTerm> queryTerms = new HashSet<>(); queryTerms.add(new ValuePackageNameIndexTerm("*", ValueIndexTerm.TermSearchType.WILDCARD)); queryTerms.add(new ValueModuleRootPathIndexTerm()); new FindPackageNamesQuery().validateTerms(queryTerms); }