### Question:
IndexRequest implements Request { @Override public ItemSource serialize() { return source; } protected  IndexRequest(Builder builder); String getId(); String getIndex(); String getType(); final ItemSource<ByteBuf> getSource(); @Override String getURI(); @Override String getHttpMethodName(); @Override ItemSource serialize(); void release(); static final String HTTP_METHOD_NAME; static final int ESTIMATED_URI_LENGTH; static final String FORWARD_SLASH; }### Answer:
@Test public void serializeRequestReturnsGivenSource() { ByteBufItemSource expectedSource = mock(ByteBufItemSource.class); IndexRequest request = createIndexRequestBuilder(expectedSource) .build(); ItemSource<ByteBuf> result = request.serialize(); Assert.assertEquals(expectedSource, result); }