code: public void add(DnsQuery query, DnsResponse response) {
  		assert eventloop.inEventloopThread() : "Concurrent cache adds are not allowed";
  		long expirationTime = now.currentTimeMillis();
  		if (response.isSuccessful()) {
  			assert response.getRecord() != null; // where are my advanced contracts so that Intellj would know it's true here without an assert?
  			long minTtl = response.getRecord().getMinTtl() * 1000;
  			if (minTtl == 0) {
  				return;
  			}
  			expirationTime += Math.min(minTtl, maxTtl);
  		} else {
  			expirationTime += response.getErrorCode() == ResponseErrorCode.TIMED_OUT ?
  					timedOutExceptionTtl :
  					errorCacheExpiration;
  		}
  		CachedDnsQueryResult cachedResult = new CachedDnsQueryResult(response, expirationTime);
  		CachedDnsQueryResult old = cache.put(query, cachedResult);
  		expirations.add(cachedResult);
  
  		if (old != null) {
  			old.response = null; // mark old cache response as refreshed (see performCleanup)
  			logger.trace("Refreshed cache entry for {}", query);
  		} else {
  			logger.trace("Added cache entry for {}", query);
  		}
  	}
docs: Adds DnsResponse to this cache
  
  @param response response to add