I know weakKeys() means the keys are wrapped by WeakReference and GC may collect the keys automatically, same with weakValues()(for value).
My understanding: Once an entry (whether key or value) was collected by GC, the entry is expired.
My question:
- Are
weakKeys()andweakValues()equivalent? (one of them was collected, the entry is expired) - Guava doc said: "when this method is used, the resulting cache will use identity (==) comparison to determine equality of values". When the cache compares the value? for what?