public Set<String> getKnownItems(String user) {
    MutableSet<String> knownItemsForUser = doGetKnownItems(user);
    if (knownItemsForUser == null) {
      return Collections.emptySet();
    }
    synchronized (knownItemsForUser) {
      if (knownItemsForUser.isEmpty()) {
        return Collections.emptySet();
      }
      // Must copy since the original object is synchronized
      return knownItemsForUser.clone().asUnmodifiable();
    }
  }
public Set < String > getKnownItems ( String user ) { MutableSet < String > knownItemsForUser = doGetKnownItems ( user ) ; if ( knownItemsForUser == null ) { return Collections . emptySet ( ) ; } synchronized ( knownItemsForUser ) { if ( knownItemsForUser . isEmpty ( ) ) { return Collections . emptySet ( ) ; } return knownItemsForUser . clone ( ) . asUnmodifiable ( ) ; } }
@param user user to get known items for
@return set of known items for the user (immutable, but thread-safe)