DismissalDao { @Query("SELECT * FROM " + DismissalTable.TABLE_NAME + " WHERE " + DismissalTable.Columns.CARD_TYPE + " = :type") public abstract List<CardDismissal> getForType(@Card.Type int type);  @Query("SELECT * FROM " + DismissalTable.TABLE_NAME + " WHERE " + DismissalTable.Columns.CARD_TYPE + " = :type") abstract List<CardDismissal> getForType(@Card.Type int type); @Query("SELECT " + DismissalTable.Columns.CARD_TYPE + ", " + DismissalTable.Columns.IDENTIFIER + " FROM " + DismissalTable.TABLE_NAME + " WHERE " + DismissalTable.Columns.CARD_TYPE + " = :type") abstract List<CardIdentifier> getIdsForType(@Card.Type int type); @Insert abstract void insert(CardDismissal dismissal); @Update abstract void update(CardDismissal dismissal); @Delete abstract void delete(CardDismissal dismissal); @Query("DELETE FROM " + DismissalTable.TABLE_NAME) abstract void deleteAll(); @Transaction void deleteByIdentifier(Collection<CardIdentifier> identifiers); void prune(@Card.Type int type, List<Card> allCards);  }
@Test public void shouldGetOneType_WhenRequestingOneType() { List<CardDismissal> expected = cards.stream() .filter(c -> c.getIdentifier().getCardType() == Card.Type.RESTO) .collect(Collectors.toList()); List<CardDismissal> actual = dismissalDao.getForType(Card.Type.RESTO); assertCollectionEquals(expected, actual); }