logic was there previously and seems to be correct as per javadoc