code: @Override
      public List<Post> findRelatedPosts(Post post, int size) {
          if (size <= 0) {
              return null;
          }
  
          List<Category> categories = post.getCategories();
          List<Tag> tags = post.getTags();
          if (categories.isEmpty() || tags.isEmpty()) {
              return null;
          }
  
          List<Post> allRelatedPosts = new ArrayList<Post>();
  
          for (Category category : categories) {
              mergeRelatedPosts(allRelatedPosts, post, category.getPages());
          }
  
          for (Tag tag : tags) {
              mergeRelatedPosts(allRelatedPosts, post, tag.getPages());
          }
  
          if (allRelatedPosts.isEmpty()) {
              return Collections.emptyList();
          }
          Collections.sort(allRelatedPosts);
          Collections.reverse(allRelatedPosts);
  
          if (size > allRelatedPosts.size()) {
              size = allRelatedPosts.size();
          }
          return allRelatedPosts.subList(0, size);
      }
docs: /* (non-Javadoc)
  @see org.opoo.press.RelatedPostsFinder#findRelatedPosts(org.opoo.press.Post, int)