code: @Override
      @Deprecated
      public ChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead) {
          try {
              MaxMessagesRecvByteBufAllocator allocator = getRecvByteBufAllocator();
              allocator.maxMessagesPerRead(maxMessagesPerRead);
              return this;
          } catch (ClassCastException e) {
              throw new IllegalStateException("getRecvByteBufAllocator() must return an object of type " +
                      "MaxMessagesRecvByteBufAllocator", e);
          }
      }
docs: {@inheritDoc}
  <p>
  @throws IllegalStateException if {@link #getRecvByteBufAllocator()} does not return an object of type
  {@link MaxMessagesRecvByteBufAllocator}.