Group { public static Group of(String name, Setting<?>... settings) { return new Group(name, ImmutableList.copyOf(settings)); } private  Group(String name, ImmutableList<Setting<?>> settings); static Group of(String name, Setting<?>... settings); static Group of(String name, Collection<Setting<?>> settings); String getName(); ImmutableList<Setting<?>> getSettings();  }
@Test public void testInvalidNames() { assertAll( () -> assertThrows(NullPointerException.class, () -> Group.of(null)), () -> assertThrows(IllegalArgumentException.class, () -> Group.of("")), () -> assertThrows(IllegalArgumentException.class, () -> Group.of(" ")), () -> assertThrows(IllegalArgumentException.class, () -> Group.of("\n")), () -> assertThrows(IllegalArgumentException.class, () -> Group.of("\t")) ); }