updated JavaDoc (added tests)