PropertyModel<String> model = new PropertyModel<String>(new PFUserDO(), "username");
assertInteger(255, MaxLengthTextField.getMaxLength(model));
assertInteger(255, MaxLengthTextField.getMaxLength(model, 300));
assertInteger(100, MaxLengthTextField.getMaxLength(model, 100));
model = new PropertyModel<String>(new BaseSearchFilter(), "searchString");
Assert.assertNull(MaxLengthTextField.getMaxLength(model));
assertInteger(100, MaxLengthTextField.getMaxLength(model, 100));
Assert.assertNull(MaxLengthTextField.getMaxLength(Model.of("test")));
assertInteger(100, MaxLengthTextField.getMaxLength(Model.of("test"), 100));