private void historyAdd(String text){
  if (!text.isEmpty()) {
    history.remove(text);
    history.add(text);
  }
}

private void historyAdd ( String text ) { if ( ! text . isEmpty ( ) ) { history . remove ( text ) ; history . add ( text ) ; } }
adds the given text to the history . mainly used when text is send . the text is removed first , so it only occurs once . only text that is not empty is added .
