Add javadoc to show thread-safety