### Question:
BrowsableFileField extends BrowsableField { @Override public void setTextFromFile(File inputFile) { if (inputFile != null) { getTextField().setText(inputFile.getAbsolutePath()); getTextField().validate(); } } BrowsableFileField(FileType fileType, OpenType openType);  BrowsableFileField(FileType fileType, OpenType openType, Button browseButton); void enforceValidation(boolean selectedFileMustExists, boolean allowEmptyString); @Override void setTextFromFile(File inputFile);  }### Answer:
@Test public void setTextFromNullFile() { BrowsableFileField victim = new BrowsableFileField(FileType.PDF, OpenType.OPEN); assertEquals(ValidationState.NOT_VALIDATED, victim.getTextField().getValidationState()); victim.setTextFromFile(null); assertEquals(ValidationState.NOT_VALIDATED, victim.getTextField().getValidationState()); }