Hi, As Andrey pointed out, now you can grab an expiry policy factory from Ignite's cache configuration, create an instance and get durations you need. I agree that this way a bit awkward and it only covers a configured ExpiryPolicy, currently there is no way to check if an instance of IgniteCache was created using withExpiryPolicy() method.
I think it should be ok to add getExpiryPolicy() on IgniteCache which will return a configured expiry policy (possibly null) if this is a default cache instance, and user-specified expiry policy if cache instance was created using withExpiryPolicy(). Cross-posting this to Ignite dev list to see what dev community thinks.