DSCIT100Command implements Command { public static DSCIT100Command createCommand(String command, String address, String code, String target, DSCIT100ConnectionManager mgr) { command = Strings.toUpperCase(command.trim()); ExecuteCommand execCommand = ExecuteCommand.createCommand(command, address, code, target, mgr); if (execCommand != null) { return execCommand; } ReadCommand readCommand = ReadCommand.createCommand(command, address, target, mgr); if (readCommand != null) { return readCommand; } throw new NoSuchCommandException("Unknown command '" + command + "'."); } DSCIT100Command(String address, String target, DSCIT100ConnectionManager connectionManager); static DSCIT100Command createCommand(String command, String address, String code,
                                              String target, DSCIT100ConnectionManager mgr);  }
@Test public void testCreateCommand() { Command command = DSCIT100Command.createCommand("ARM", "1.1.1.1:50", "1234", "1", connManager); assertTrue(command instanceof DSCIT100Command); }