@Test
void addChild_duplicate_throws_exception() {

    when(map.register(any())).thenReturn(new DispatcherCommand("", null, null, null, List.of("")));
    
    root.addChild(Literal.of("a").build());
    
    assertEquals("Invalid command: 'a', root already contains a child with the same name",
        assertThrows(IllegalArgumentException.class, () -> root.addChild(Literal.of("a").build())).getMessage()
    );
}