### Question:
LengthValidator implements Validator<Object> { @Override public Object generateRandomValid() { throw new UnsupportedOperationException("Operação não suportada por este validador"); } LengthValidator(int validLength);  LengthValidator(MessageProducer messageProducer, int validLength); void assertValid(Object object); List<ValidationMessage> invalidMessagesFor(Object object); boolean isEligible(Object object); @Override Object generateRandomValid();  }### Answer:
@Test(expected=UnsupportedOperationException.class) public void shouldThrowExceptionWhenGeneratingRandomValue() { new LengthValidator(2).generateRandomValid(); }