code: public static <K, V> Duration getExpiryForCreation(K key, V value, ExpiryPolicy<? super K, ? super V> expiry) {
      Duration duration;
      try {
        duration = expiry.getExpiryForCreation(key, value);
      } catch (RuntimeException e) {
        LOG.error("Expiry computation caused an exception - Expiry duration will be 0", e);
        return Duration.ZERO;
      }
  
      if (duration == null) {
        LOG.error("Expiry for creation can't be null - Expiry duration will be 0");
        return Duration.ZERO;
      }
  
      if (Duration.ZERO.compareTo(duration) >= 0) {
        return Duration.ZERO;
      }
  
      return duration;
    }
docs: Returns the expiry for creation duration returned by the provided {@link ExpiryPolicy} but checks for immediate
  expiry, null expiry and exceptions. In all those cases, {@code null} will be returned.
  
  @param key key to pass to {@link ExpiryPolicy#getExpiryForCreation(Object, Object)}
  @param value value to pass to to pass to {@link ExpiryPolicy#getExpiryForCreation(Object, Object)}
  @param expiry expiry queried
  @param <K> type of key
  @param <V> type of value
  @return the duration returned by to pass to {@link ExpiryPolicy#getExpiryForCreation(Object, Object)}, {@code null}
  if the call throws an exception, if the returned duration is {@code null} or if it is lower or equal to 0