JsonDataStoreQueue { public void removeAll() { synchronized (storeKey) { dataStore.remove(storeKey); } } JsonDataStoreQueue(@NonNull PreferenceDataStore dataStore,
                              @NonNull String storeKey,
                              @NonNull Function<T, ? extends JsonSerializable> serializer,
                              @NonNull Function<JsonValue, T> deserializer); void removeAll(); void addAll(@NonNull List<T> values); void add(@NonNull T value); @Nullable T pop(); @Nullable T peek(); @NonNull List<T> getList(); void apply(Function<List<T>, List<T>> listOperation);  }
@Test public void testRemoveAll() { queue.add(JsonValue.wrapOpt("neat")); queue.add(JsonValue.wrapOpt("rad")); assertEquals(2, queue.getList().size()); queue.removeAll(); assertTrue(queue.getList().isEmpty()); assertNull(queue.peek()); assertNull(queue.pop()); }