private List<PostMetadata> metadataForCategory(Category category) { return category .getPostsSet() .stream() .map(post -> post.getMetadata()) .filter(md -> md != null) .collect(toList()); }
private List<Wrap> postsForCategory(Category category) { return category != null ? new PostsPresentationBean(category.getPostsSet()).getVisiblePosts(NUM_POSTS) : emptyList(); }