### Question:
ImmutableGroup implements CommandGroup { @CheckReturnValue @Nonnull public static ImmutableGroupBuilder builder() { return new ImmutableGroupBuilder(); } private  ImmutableGroup(
      ImmutableGroup parent, Set<String> names, Set<? extends CommandCallable> commands); @Nonnull static CommandGroup merge(@Nonnull CommandGroup... rootGroups); @Nonnull static CommandGroup merge(@Nonnull Collection<? extends CommandGroup> rootGroups); @CheckReturnValue @Nonnull static ImmutableGroupBuilder builder(); @Nonnull static ImmutableGroup childlessRoot(@Nonnull Set<CommandCallable> commands); @Nonnull static ImmutableGroup copyOf(@Nonnull CommandGroup group); @Nonnull static ImmutableGroup of(@Nonnull T root, @Nonnull GroupAssembler<T> assembler); @Nonnull @Override Optional<ImmutableGroup> getParent(); @Nonnull @Override Set<ImmutableGroup> getChildren(); @Nonnull @Override Set<String> getNames(); @Nonnull @Override Set<? extends CommandCallable> getCommands(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static final ImmutableGroup EMPTY; }### Answer:
@Test void testEmptyGroupNamesReaction() { assertThrows(IllegalArgumentException.class, () -> ImmutableGroup.builder().group().parent().build(), "ImmutableGroup did not throw for empty group names"); }
@Test void testMultipleEmptyCommandLabelsReaction() { CommandCallable one = AssembledCommandCallable.builder() .withLabels() .withAction((a, c) -> { }) .build(); CommandCallable two = AssembledCommandCallable.builder() .withLabels() .withAction((a, c) -> { }) .build(); assertThrows(IllegalArgumentException.class, () -> ImmutableGroup.builder() .add(one) .add(two) .build(), "ImmutableGroup did not throw for multiple empty command labels"); }
@Test void testGroupNameDuplicateReaction() { assertThrows(IllegalArgumentException.class, () -> ImmutableGroup.builder() .group("foo", "bar", "baz", "w") .parent() .group("lig", "wer", "bar") .parent().build(), "ImmutableGroup did not throw for duplicate group names"); }
@Test void testCommandLabelDuplicateReaction() { CommandCallable one = AssembledCommandCallable.builder() .withLabels("foo", "bar", "baz", "w") .withAction((a, c) -> { }) .build(); CommandCallable two = AssembledCommandCallable.builder() .withLabels("lig", "wer", "bar") .withAction((a, c) -> { }) .build(); assertThrows(IllegalArgumentException.class, () -> ImmutableGroup.builder() .add(one) .add(two) .build(), "ImmutableGroup did not throw for duplicate command labels"); }