@Override
    public void listBlogPosts(ListBlogPostsRequest request,
                              StreamObserver<ListBlogPostsResponse> responseObserver) {
        final Collection<BlogPost> blogPosts;
        if (request.getDescending()) {
            blogPosts = this.blogPosts.entrySet()
                                      .stream()
                                      .sorted(Collections.reverseOrder(Comparator.comparingInt(Entry::getKey)))
                                      .map(Entry::getValue).collect(Collectors.toList());
        } else {
            blogPosts = this.blogPosts.values();
        }
        responseObserver.onNext(ListBlogPostsResponse.newBuilder().addAllBlogs(blogPosts).build());
        responseObserver.onCompleted();
    }
Retrieves a {@link BlogPost} whose {@link BlogPost#getId()} is the {@link GetBlogPostRequest#getId()}.
examples/tutorials/grpc/src/main/java/example/armeria/server/blog/grpc/BlogService.java