CommandResult { public static CommandResult withBuffer(IntBuffer responseBuffer) { return new CommandResult(responseBuffer); } private  CommandResult(IntBuffer responseBuffer); static CommandResult empty(); static CommandResult withBuffer(IntBuffer responseBuffer); int getByteNumber(int byteNumber);  }
@Test public void withBufferShouldCreateResultWithPassedBuffer() throws Exception { IntBuffer expectedResponseBuffer = IntBuffer.allocate(0); sut = CommandResult.withBuffer(expectedResponseBuffer); IntBuffer responseBuffer = sut.getResponseBuffer(); assertThat(responseBuffer).isEqualTo(expectedResponseBuffer); }