Expansion of date() method and new castToLong method in ObjectUtil