public void addMessage(String message){
  messages.addLast(message);
  if (messages.size() > MAX_HISTORY) {
    messages.removeFirst();
  }
  pointer=messages.size();
}

public void addMessage ( String message ) { messages . addLast ( message ) ; if ( messages . size ( ) > MAX_HISTORY ) { messages . removeFirst ( ) ; } pointer = messages . size ( ) ; }
add a message to the history
