ClassificationRule implements Validator<Patent> { @Override public boolean test(Patent patent) { if (patent.getClassification() == null || patent.getClassification().isEmpty()){ return false; } return true; }  @Override boolean test(Patent patent); @Override String getName(); @Override String getMessage();  }
@Test public void failMissingClassification() { PatentApplication patent = new PatentApplication(new DocumentId(CountryCode.US, "99999"), PatentType.UTILITY); assertFalse(classificationRule.test(patent)); }
@Test public void passContainsClassification() { PatentApplication patent = new PatentApplication(new DocumentId(CountryCode.US, "99999"), PatentType.UTILITY); UspcClassification uspc = new UspcClassification("A01Z", false); patent.addClassification(uspc); assertTrue(classificationRule.test(patent)); }