ClaimRule implements Validator<Patent> { @Override public boolean test(Patent patent) { if (patent.getClaims() == null || patent.getClaims().isEmpty() || patent.getClaims().get(0).getRawText().length() < 15) { return false; } return true; }  @Override boolean test(Patent patent); @Override String getName(); @Override String getMessage();  }
@Test public void emptyClaimListFail() { PatentApplication patent = new PatentApplication(new DocumentId(CountryCode.US, "99999"), PatentType.UTILITY); List<Claim> claims = new ArrayList<Claim>(); patent.setClaim(claims); assertFalse(claimRule.test(patent)); }
@Test public void smallFirstClaimFail() { PatentApplication patent = new PatentApplication(new DocumentId(CountryCode.US, "99999"), PatentType.UTILITY); List<Claim> claims = new ArrayList<Claim>(); Claim claim = new Claim("CLAIM-1", "my first claim", ClaimType.INDEPENDENT, new DummyFormattedText()); claims.add(claim); patent.setClaim(claims); assertFalse(claimRule.test(patent)); }