### Question:
AcceptAnyValidator implements Validator<String> { public List<ValidationMessage> invalidMessagesFor(String value) { List<ValidationMessage> result = new ArrayList<ValidationMessage>(); for (Validator<String> validator : validators) { List<ValidationMessage> messages = validator.invalidMessagesFor(value); if (messages.isEmpty()) { result.clear(); break; } else { result.addAll(messages); } } return result; } AcceptAnyValidator(Documento... documentos);  AcceptAnyValidator(boolean isFormatted, Documento... documentos);  AcceptAnyValidator(MessageProducer messageProducer, boolean isFormatted, Documento... documentos); void assertValid(String value); List<ValidationMessage> invalidMessagesFor(String value); boolean isEligible(String object); @Override String generateRandomValid();  }### Answer:
@Test public void testInvalidMessagesForCpf() { Validator<String> validator = new AcceptAnyValidator(Documento.CPF); String cpf = "336.397.038-20"; Assert.assertTrue(validator.invalidMessagesFor(cpf).isEmpty()); }
@Test public void testAssertValidForCpnj() { Validator<String> validator = new AcceptAnyValidator(Documento.CNPJ); String cnpj = "26.637.142/0001-58"; Assert.assertTrue(validator.invalidMessagesFor(cnpj).isEmpty()); }
@Test public void testInvalidMessagesForInvalidCpf() { Validator<String> validator = new AcceptAnyValidator(Documento.CPF); String cpf = "336.397.038-10"; Assert.assertFalse(validator.invalidMessagesFor(cpf).isEmpty()); }
@Test public void testAssertValidForInvalidCpnj() { Validator<String> validator = new AcceptAnyValidator(Documento.CNPJ); String cnpj = "26.637.142/0001-68"; Assert.assertFalse(validator.invalidMessagesFor(cnpj).isEmpty()); }
@Test public void testInvalidMessagesForUnformatedCpf() { Validator<String> validator = new AcceptAnyValidator(false, Documento.CPF); String cpf = "33639703820"; Assert.assertTrue(validator.invalidMessagesFor(cpf).isEmpty()); }
@Test public void testAssertValidForUnformatedCpnj() { Validator<String> validator = new AcceptAnyValidator(false, Documento.CNPJ); String cnpj = "26637142000158"; Assert.assertTrue(validator.invalidMessagesFor(cnpj).isEmpty()); }