Fixed bug in unit test that only shows in OpenJDK