Adding unit tests
Workaround for JDK bug