@@ -0,0 +1,2164 @@
+package org.telegram.telegrambots.extensions.bots.commandbot.commands;%0A%0Aimport org.junit.jupiter.api.Assertions;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.mockito.Mockito;%0Aimport org.telegram.telegrambots.meta.api.objects.Message;%0Aimport org.telegram.telegrambots.meta.bots.AbsSender;%0A%0Aclass CommandRegistryTest %7B%0A%0A    @Test%0A    void should_executes_commandWithBotUsername() %7B%0A        CommandRegistry registry = new CommandRegistry(true, () -%3E %22BotUsername%22);%0A        IBotCommand command = Mockito.mock(IBotCommand.class);%0A        Mockito.when(command.getCommandIdentifier()).thenReturn(%22command%22);%0A        registry.register(command);%0A        AbsSender absSender = Mockito.mock(AbsSender.class);%0A        Message message = Mockito.mock(Message.class);%0A        Mockito.when(message.hasText()).thenReturn(true);%0A        Mockito.when(message.getText()).thenReturn(%22/command@BotUsername I'll be test!%22);%0A        Assertions.assertTrue(registry.executeCommand(absSender, message), %22Command must be executed%22);%0A        Mockito.verify(message).hasText();%0A        Mockito.verify(message).getText();%0A        Mockito.verify(command).processMessage(%0A                Mockito.same(absSender), Mockito.same(message), Mockito.eq(new String%5B%5D%7B%22I'll%22, %22be%22, %22test!%22%7D));%0A    %7D%0A%0A    @Test%0A    void should_throws_NPE_on_executes_commandWithNullableBotUsername() %7B%0A        CommandRegistry registry = new CommandRegistry(true, () -%3E null);%0A        IBotCommand command = Mockito.mock(IBotCommand.class);%0A        Mockito.when(command.getCommandIdentifier()).thenReturn(%22command%22);%0A        registry.register(command);%0A        AbsSender absSender = Mockito.mock(AbsSender.class);%0A        Message message = Mockito.mock(Message.class);%0A        Mockito.when(message.hasText()).thenReturn(true);%0A        Mockito.when(message.getText()).thenReturn(%22/command@BotUsername ignore%22);%0A        NullPointerException exception = Assertions.assertThrows(%0A                NullPointerException.class, () -%3E registry.executeCommand(absSender, message), %22Bot username is null%22);%0A        Assertions.assertEquals(%22Bot username must not be null%22, exception.getMessage(), %22Invalid exception message%22);%0A    %7D%0A%7D

Create tests for CommandRegistry