public String goBack(){
  if (pointer > 0) {
    pointer--;
  }
  if (messages.size() > 0) {
    return messages.get(pointer);
  }
  return null;
}

public String goBack ( ) { if ( pointer > 0 ) { pointer -- ; } if ( messages . size ( ) > 0 ) { return messages . get ( pointer ) ; } return null ; }
go back in history
