### Question:
IntegerField extends AbstractNumberField<Integer> { @Override protected void userInputToValue(String str) { if (StringUtils.isNotBlank(str)) { setValue(Integer.parseInt(str)); } else { setValue(null); } } IntegerField();  IntegerField(String caption); @Override Class<? extends Integer> getType(); IntegerField withCaption(String caption); IntegerField withId(String id); IntegerField withFullWidth(); IntegerField withWidth(float width, Unit unit); IntegerField withWidth(String width); @Override IntegerField withBlurListener(FieldEvents.BlurListener listener); @Override IntegerField withFocusListener(FieldEvents.FocusListener listener);  }### Answer:
@Test public void testUserInputToValue_changeValueToNull() { fieldUnderTest.userInputToValue("2"); fieldUnderTest.userInputToValue(""); assertThat(fieldUnderTest.getValue(), is((Integer) null)); }
@Test public void testUserInputToValue() { fieldUnderTest.userInputToValue("2"); assertThat(fieldUnderTest.getValue(), is(2)); }