### Question:
YesNo extends AbstractField<YesNo> { public static YesNo of(String name) { return new YesNo(name); } protected  YesNo(String name); static YesNo of(String name);  }### Answer:
@Test public void visibleIf_not_present_if_null() throws JsonProcessingException { assertJsonWrite( object() .with("type", "yesno") .with("name", "test") .with("label", "Test") .with("required", true) .with("readOnly", false) .withNull("validation") .with("help", "") .withNull("value") .end(), YesNo.of("test").label("Test") ); }
@Test public void visibleIf_present_if_not_null() throws JsonProcessingException { assertJsonWrite( object() .with("type", "yesno") .with("name", "test") .with("label", "Test") .with("required", true) .with("readOnly", false) .withNull("validation") .with("help", "") .with("visibleIf", "enabled") .withNull("value") .end(), YesNo.of("test").label("Test").visibleIf("enabled") ); }