added tests. passed checkstyle.