### Question:
RelocationInformationRequiredInfoValidation extends GenericValidation { @Override public boolean validate(AttributedDocumentEvent event) { boolean valid = true; TravelRelocationDocument document = (TravelRelocationDocument) event.getDocument(); if (document.getFromCountryCode() != null && document.getFromCountryCode().equals(USA_COUNTRY_CODE)) { valid = !(document.getFromStateCode() == null || document.getFromStateCode().equals("")); if (!valid) { GlobalVariables.getMessageMap().putError(TravelRelocationFields.FROM_STATE, TemKeyConstants.ERROR_RELO_FROM_STATE_REQUIRED); return valid; } } if (document.getToCountryCode() != null && document.getToCountryCode().equals(USA_COUNTRY_CODE)) { valid = !(document.getToStateCode() == null || document.getToStateCode().equals("")); if (!valid) { GlobalVariables.getMessageMap().putError(TravelRelocationFields.TO_STATE, TemKeyConstants.ERROR_RELO_TO_STATE_REQUIRED); return valid; } } if (document.getDocumentGrandTotal().isLessEqual(KualiDecimal.ZERO)) { GlobalVariables.getMessageMap().putError(KFSConstants.DOCUMENT_PROPERTY_NAME + "." + TemPropertyConstants.TRVL_AUTH_TOTAL_ESTIMATE, TemKeyConstants.ERROR_DOCUMENT_TOTAL_ESTIMATED); valid = false; } return valid; }  @Override boolean validate(AttributedDocumentEvent event); static final String USA_COUNTRY_CODE; static final String ATTACHMENT_TYPE_CODE_RECEIPT; }### Answer:
@Test public void testValidation() { TravelRelocationDocument document = new TravelRelocationDocument(); ActualExpense expense = new ActualExpense(); expense.setExpenseAmount(new KualiDecimal(100)); document.addActualExpense(expense); document.setFromCountryCode(validation.USA_COUNTRY_CODE); AttributedDocumentEvent event = new AttributedDocumentEventBase("description", "errorPathPrefix", document); assertFalse(validation.validate(event)); document.setFromStateCode("AZ"); assertTrue(validation.validate(event)); document.setToCountryCode(validation.USA_COUNTRY_CODE); assertFalse(validation.validate(event)); document.setToCountryCode("UK"); assertTrue(validation.validate(event)); }