Attempts to verify an RRset.  This does not modify the set.
@param set The RRset to verify
@param cache The Cache where obtained secure keys are found (may be null)
@return The new security status of the set
@see RRset
488508
public int
verify(RRset set, Cache cache) {
	Iterator sigs = set.sigs();
	if (Options.check("verbosesec"))
		System.out.print("Verifying " + set.getName() + "/" +
				 Type.string(set.getType()) + ": ");
	if (!sigs.hasNext()) {
		if (Options.check("verbosesec"))
			System.out.println("Insecure");
		return DNSSEC.Insecure;
	}
	while (sigs.hasNext()) {
		RRSIGRecord sigrec = (RRSIGRecord) sigs.next();
		if (verifySIG(set, sigrec, cache) == DNSSEC.Secure) {
			if (Options.check("verbosesec"))
				System.out.println("Secure");
			return DNSSEC.Secure;
		}
	}
	if (Options.check("verbosesec"))
		System.out.println("Failed");
	return DNSSEC.Failed;
}
629229
protected <E> void checkExistingIsSuperset(Set<E> existingSet, Set<E> newSet) {
    this.result |= !existingSet.containsAll(newSet);
  }
62406
public final Set<K> keySet() {
		try {
			Set<K> set = new HashSet<K>();
			listFilesToSet(getPath(), set);
			return set;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
1246843
public static KeySet singleKey(Key key) {
    return new KeySet(false, ImmutableList.of(key), ImmutableList.<KeyRange>of());
  }
1095512
public void setCacheSecurityGroups(java.util.Collection<CacheSecurityGroup> cacheSecurityGroups) {
        if (cacheSecurityGroups == null) {
            this.cacheSecurityGroups = null;
            return;
        }

        this.cacheSecurityGroups = new com.amazonaws.internal.SdkInternalList<CacheSecurityGroup>(cacheSecurityGroups);
    }
428210
public synchronized boolean containsKey(CacheKey key) {
    Preconditions.checkNotNull(key);
    if (!mMap.containsKey(key)) {
      return false;
    }
    EncodedImage storedEncodedImage = mMap.get(key);
    synchronized (storedEncodedImage) {
      if (!EncodedImage.isValid(storedEncodedImage)) {
        // Reference is not valid, this means that someone cleared reference while it was still in
        // use. Log error
        // TODO: 3697790
        mMap.remove(key);
        FLog.w(
            TAG,
            "Found closed reference %d for key %s (%d)",
            System.identityHashCode(storedEncodedImage),
            key.getUriString(),
            System.identityHashCode(key));
        return false;
      }
      return true;
    }
  }
527236
private Set<E> remoteSet() {
        Set<E> result = (Set<E>) cache.get(key);
        return result == null ? (Set<E>) Collections.emptySet() : result;
    }
108608
@Override
	public synchronized CacheObject get(final Object key)
	{
		final CacheObject o = map.get(key);
		if (o != null) {
			updateAccess(o);
			++hits;
		}
		else
			++misses;
		return o;
	}
890752
public void
addRRset(RRset rrset) {
	Name name = rrset.getName();
	addRRset(name, rrset);
}
1127714
public java.util.List<CacheSecurityGroup> getCacheSecurityGroups() {
        if (cacheSecurityGroups == null) {
            cacheSecurityGroups = new com.amazonaws.internal.SdkInternalList<CacheSecurityGroup>();
        }
        return cacheSecurityGroups;
    }
1311255
public static <T> Set<T> immutableSetCopy(Set<T> set) {
      if (set == null) return null;
      if (set.isEmpty()) return Collections.emptySet();
      if (set.size() == 1) return Collections.singleton(set.iterator().next());
      Set<? extends T> copy = ObjectDuplicator.duplicateSet(set);
      if (copy == null)
         // Set uses Collection copy-ctor
         copy = attemptCopyConstructor(set, Collection.class);
      if (copy == null)
         copy = new HashSet<>(set);

      return new ImmutableSetWrapper<>(copy);
   }
1035790
public boolean containsKey(Object key) {
        if( !cache.containsKey(key) ) {
            return false;
        }
        else {
            SoftReference<T> ref = cache.get(key);
            T ob = ref.get();
            
            if( ob == null ) {
                release(key);
                return false;
            }
            if( ob instanceof CachedItem ) {
                if( !((CachedItem)ob).isValidForCache() ) {
                    release(key);
                    return false;
                }
            }
            return true;
        }
    }
15255
public synchronized void setCache(RemoteListCache cache) {
		if (cache != null && (this.cache == null || !this.cache.isComplete())) {
			this.cache = cache;
		}
	}
445453
public Set<Object> hkeys(Object key) {
		Jedis jedis = getJedis();
		try {
			Set<byte[]> fieldSet = jedis.hkeys(keyToBytes(key));
			Set<Object> result = new HashSet<Object>();
			fieldSetFromBytesSet(fieldSet, result);
			return result;
		}
		finally {close(jedis);}
	}
926364
public static <T> Maybe<Set<T>> keys(String key, Class<T> kClazz) {
        return keys(CacheService.CACHE_CONFIG_BEAN, key, kClazz);
    }
425651
public static <T> ImmutableSet<ImmutableSet<T>> immutablePowerSet(Set<T> set)
    {
        return powerSet(set).collect(new Function<MutableSet<T>, ImmutableSet<T>>()
        {
            public ImmutableSet<T> valueOf(MutableSet<T> set)
            {
                return set.toImmutable();
            }
        }).toImmutable();
    }
554174
private boolean checkIfKeyExists(String key)
    {
        if (aggregationsKeySet == null)
        {
            aggregationsKeySet = new HashSet<String>();
        }
        return aggregationsKeySet.add(key);
    }