guava/src/com/google/common/cache/CacheBuilderSpec.java
private static @Nullable Long durationInNanos(long duration, @Nullable TimeUnit unit) {
    return (unit == null) ? null : unit.toNanos(duration);
  }
private static @Nullable Long durationInNanos(long duration, @Nullable TimeUnit unit) {
    return (unit == null) ? null : unit.toNanos(duration);
  }
Converts an expiration duration/unit pair into a single Long for hashing and equality. Uses
nanos to match CacheBuilder implementation.