Add unit test for JAVA-309