### Question:
Categories { public static UICategory create(UICategory category, String... categories) { Assert.notNull(category, "Parent UICategory must not be null."); Assert.notNull(categories, "Sub categories must not be null."); List<String> args = new ArrayList<>(); args.add(category.getName()); args.addAll(Arrays.asList(categories)); return create(args.toArray(new String[args.size()])); }  static UICategory createDefault(); static UICategory create(UICategory category, String... categories); static UICategory create(String... categories); static String getCategoryName(UICategory category);  }### Answer:
@Test public void testSingleCategory() { UICategory category = Categories.create("ONE"); Assert.assertNotNull(category); Assert.assertEquals("ONE", category.getName()); Assert.assertNull(category.getSubCategory()); }
@Test public void testMultipleCategory() { UICategory category = Categories.create("ONE", "TWO", "THREE"); Assert.assertNotNull(category); Assert.assertEquals("ONE", category.getName()); Assert.assertNotNull(category.getSubCategory()); Assert.assertEquals("TWO", category.getSubCategory().getName()); Assert.assertNotNull(category.getSubCategory().getSubCategory()); Assert.assertEquals("THREE", category.getSubCategory().getSubCategory().getName()); Assert.assertNull(category.getSubCategory().getSubCategory().getSubCategory()); }