Console implements Initializable { public static List<String> createLog(String level, String msg) { List<String> log = new ArrayList<>(); if (msg == null) { return log; } if (level != null && !"".equals(level) && isLevel(level)) { log.add(0, level); } else { log.add(0, "MISC"); } log.add(1, msg); return log; } 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 createLogTest() { List<String> logElement; List<String> miscLog = new ArrayList<>(); String logMsg = "you merly adopted the testing, i was born in it, " + "molded by it"; miscLog.add(0, "MISC"); miscLog.add(1, logMsg); logElement = Console.createLog("MISC", null); Assert.assertEquals(0, logElement.size()); logElement = Console.createLog(null, logMsg); Assert.assertEquals(miscLog, logElement); logElement = Console.createLog("", logMsg); Assert.assertEquals(miscLog, logElement); logElement = Console.createLog("Batman", logMsg); Assert.assertEquals(miscLog, logElement); }