add method passes JUnit tests