Fix simple Java test memory check