more unit tests in Java and C++