/** * Get the items appearing in the training set and not in the data model. * * @param model The data model. * @param user The user. * @return The items not appearing in the training set. */ protected Set<Long> getModelTrainingDifference(final DataModelIF<Long, Long> model, final Long user) { final Set<Long> items = new HashSet<Long>(); if (training.getUserItems(user) != null) { final Set<Long> trainingItems = new HashSet<>(); for (Long i : training.getUserItems(user)) { trainingItems.add(i); } for (Long item : model.getItems()) { if (!trainingItems.contains(item)) { items.add(item); } } } return items; }