unit test & java code