List of usage examples for java.util HashSet HashSet
public HashSet()
From source file:Main.java
public static void removeFromFavorites(final Context context, long movieId) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); Set<String> set = sp.getStringSet(PREF_FAVORED_MOVIES, null); if (set == null) set = new HashSet<>(); set.remove(String.valueOf(movieId)); sp.edit().putStringSet(PREF_FAVORED_MOVIES, set).apply(); }
From source file:Main.java
public static <V> HashSet<V> getHashSet(final Map<?, ? extends V> map, final Object... keys) { final HashSet<V> result = new HashSet<V>(); get(map, result, keys);//from w w w . j a va 2 s. c o m return result; }