### Question:
Shortcuts { public static boolean empty(Object obj) { boolean empty = false; if(null == obj) { empty = true; } else if(obj instanceof Boolean) { empty = ! (Boolean) obj; } else if(obj instanceof Collection) { empty = ((Collection) obj).size() == 0; } else if(obj instanceof String) { empty = Strings.isEmpty((String) obj); } else if(obj.getClass().isArray()) { empty = ((Object[])obj).length == 0; } return empty; } private  Shortcuts(); static PropertyModel prop(Object bean, String propertyExpr); static LoadableDetachableModel loadedModel(final Object bean,
                                                      final String loadMethod); static LabelWithPlaceholder label(String id); static LabelWithPlaceholder label(String id,
                                             Object bean,
                                             String propertyExpr); static LabelWithPlaceholder label(String id,
                                             Serializable valueOrIModel); static Behavior afterTag(final String textToAppend); static Behavior cssClass(IModel<String> cssClass); static Behavior cssClass(String cssClass); static Behavior toggledCssClass(String classIfTrue, IModel<Boolean> toggle); static Behavior toggledCssClass(final String classIfTrue,
                                           final String classIfFalse,
                                           final IModel<Boolean> toggle); static Behavior cssResource(Class<?> cls); static Behavior cssResource(String filename); static Behavior cssResource(String filename, String media); static Behavior cssResource(Class<?> scope, String filename); static Behavior cssResource(final Class<?> scope,
                                       final String filename,
                                       final String media); static Behavior cssPrintResource(final String filename); static Behavior cssConditionalResource(String cond, String filename); static boolean empty(Object obj);  }### Answer:
@Test public void testEmpty() { Assert.assertTrue(Shortcuts.empty(null)); Assert.assertTrue(Shortcuts.empty("")); Assert.assertTrue(Shortcuts.empty(" ")); Assert.assertTrue(Shortcuts.empty(Collections.EMPTY_LIST)); Assert.assertTrue(Shortcuts.empty(new String[0])); Assert.assertTrue(Shortcuts.empty(false)); Assert.assertFalse(Shortcuts.empty(new Object())); Assert.assertFalse(Shortcuts.empty("a")); Assert.assertFalse(Shortcuts.empty(" a ")); Assert.assertFalse(Shortcuts.empty(Collections.singleton("a"))); Assert.assertFalse(Shortcuts.empty(new String[] { "a" })); Assert.assertFalse(Shortcuts.empty(true)); }