@SuppressWarnings ("unchecked" )
   @Override
   public boolean retainAll( Collection<?> collection )
   {
      final int previousSize = trie.size();
      final Trie<E, Object> newTrie = trie.newEmptyClone();

      for (Object element : collection)
      {
         if (trie.containsKey( element ))
         {
            newTrie.put( (E)element, FLAG );
         }
      }

      trie = newTrie;

      return previousSize != trie.size();
   }