public static boolean shouldDelete(Feed feed) {
        if (feed.getState() != Feed.STATE_NOT_SUBSCRIBED) {
            return false;
        } else if (feed.getItems() == null) {
            return false;
        }
        for (FeedItem item : feed.getItems()) {
            if (item.isTagged(FeedItem.TAG_FAVORITE)
                    || item.isTagged(FeedItem.TAG_QUEUE)
                    || item.isDownloaded()) {
                return false;
            }
        }
        return feed.getLastRefreshAttempt() < System.currentTimeMillis() - TIME_TO_KEEP;
    }
@Test
    public void testFavoriteItem() {
        Feed feed = createFeed();
        feed.setState(Feed.STATE_NOT_SUBSCRIBED);
        feed.setLastRefreshAttempt(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(200, TimeUnit.DAYS));
        feed.getItems().add(createItem(feed));
        assertTrue(NonSubscribedFeedsCleaner.shouldDelete(feed));

        FeedItem queuedItem = createItem(feed);
        queuedItem.addTag(FeedItem.TAG_FAVORITE);
        feed.getItems().add(queuedItem);
        assertFalse(NonSubscribedFeedsCleaner.shouldDelete(feed));
    }