code: private static long pickTTLMillis(long operationTTLMillis, long existingTTLMillis, MapConfig mapConfig,
                                        boolean consultMapConfig) {
          // if user set operationTTLMillis when calling operation, use it
          if (operationTTLMillis > 0) {
              return checkedTime(operationTTLMillis);
          }
  
          // if this is the first creation of entry, try to get TTL from mapConfig
          if (consultMapConfig && operationTTLMillis < 0 && mapConfig.getTimeToLiveSeconds() > 0) {
              return checkedTime(SECONDS.toMillis(mapConfig.getTimeToLiveSeconds()));
          }
  
          // if operationTTLMillis < 0, keep previously set TTL on record
          if (operationTTLMillis < 0) {
              return checkedTime(existingTTLMillis);
          }
  
          // if we are here, entry should live forever
          return Long.MAX_VALUE;
      }
docs: Decides if TTL millis should to be set on record.
  
  @param existingTTLMillis  existing TTL on record
  @param operationTTLMillis user provided TTL during operation call like put with TTL
  @param mapConfig          used to get configured TTL
  @param consultMapConfig   give {@code true} if this update should consult map ttl configuration,
  otherwise give {@code false}
  @return TTL value in millis to set to record