Console implements Initializable { public Boolean parseCommand(String input) { if (input == null) { return false; } String commandInput = input.trim(); String[] commandParameters = commandInput.split(" "); for (BaseHandler handler : handlers) { if (handler.contains(commandParameters[0])) { handler.handle(commandParameters); return true; } } return false; } Console(); static Console getInstance(); @Override void initialize(URL location, ResourceBundle resources); void attachGui(Stage gui); void close(); boolean show(); List<String> getCommandKeys(); @FXML void sendInput(ActionEvent event); void setInitText(); void printCommand(String command); void commandHelp(); void clear(); Boolean parseCommand(String input); void print(String input); void println(String input); String getConsoleOutputBuffer(); static boolean isLevel(String proposedLevel); static List<String> createLog(String level, String msg); void addLog(String level, String msg); List<String> getLog(String level); void clearLog(); void appendLog(List<String> log); Text formatLog(String level, String msg);  }
@Test public void handleCommand() { Console console = new Console(); Assert.assertFalse("Testing null parameter", console.parseCommand(null)); Assert.assertTrue("Testing a known util command", console.parseCommand("echo testing command")); }