### Question:
HideWhenEmptyOrNullBehavior extends Behavior { public static Behavior get() { return INSTANCE; } private  HideWhenEmptyOrNullBehavior(); static Behavior get(); @Override void onConfigure(final Component component);  }### Answer:
@Test public void testComponentNotPresentOnNullModel() { tester.startComponentInPage( new Label(CID_LABEL, Model.of((Serializable)null)).add(HideWhenEmptyOrNullBehavior.get()), Markup.of(MARKUP)); assertNull(tester.getTagByWicketId(CID_LABEL)); }
@Test public void testComponentPresentOnNotNullModel() { tester.startComponentInPage( new Label(CID_LABEL, Model.of(1)).add(HideWhenEmptyOrNullBehavior.get()), Markup.of(MARKUP)); assertNotNull(tester.getTagByWicketId(CID_LABEL)); }
@Test public void testComponentNotPresentOnEmptyStringModel() { tester.startComponentInPage( new Label(CID_LABEL, Model.of("")).add(HideWhenEmptyOrNullBehavior.get()), Markup.of(MARKUP)); assertNull(tester.getTagByWicketId(CID_LABEL)); }
@Test public void testComponentPresentOnNonEmptyStringModel() { tester.startComponentInPage( new Label(CID_LABEL, Model.of("test")).add(HideWhenEmptyOrNullBehavior.get()), Markup.of(MARKUP)); assertNotNull(tester.getTagByWicketId(CID_LABEL)); }
@Test public void testComponentNotPresentOnEmptyCollectionModel() { tester.startComponentInPage( new Label(CID_LABEL, new ListModel<>(Collections.emptyList())).add(HideWhenEmptyOrNullBehavior.get()), Markup.of(MARKUP)); assertNull(tester.getTagByWicketId(CID_LABEL)); }
@Test public void testComponentPresentOnNonEmptyCollectionModel() { tester.startComponentInPage( new Label(CID_LABEL, new ListModel<>(Arrays.asList("test"))).add(HideWhenEmptyOrNullBehavior.get()), Markup.of(MARKUP)); assertNotNull(tester.getTagByWicketId(CID_LABEL)); }