added a javadoc comment to getMessages method