### Question:
CoapTcpCSM { public int getMaxOutboundPayloadSize() { BlockSize blockSize = getBlockSize(); if (blockSize == null) { return getMaxMessageSizeInt(); } if (!blockSize.isBert()) { return blockSize.getSize(); } int maxBertBlocksCount = blockSize.numberOfBlocksPerMessage(getMaxMessageSizeInt()); if (maxBertBlocksCount > 1) { return (maxBertBlocksCount - 1) * blockSize.getSize(); } else { return blockSize.getSize(); } } CoapTcpCSM(long maxMessageSize, boolean blockwiseTransfer); static CoapTcpCSM min(CoapTcpCSM cap1, CoapTcpCSM cap2); CoapTcpCSM withNewOptions(Long maxMessageSize, Boolean blockwiseTransfer); boolean isBlockTransferEnabled(); boolean useBlockTransfer(byte[] payload); long getMaxMessageSize(); int getMaxMessageSizeInt(); boolean isBERTEnabled(); BlockSize getBlockSize(); int getMaxOutboundPayloadSize(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final CoapTcpCSM BASE; }### Answer:
@Test public void should_return_maxOutboundPayloadSize() { assertEquals(2000, new CoapTcpCSM(2000, false).getMaxOutboundPayloadSize()); assertEquals(16, new CoapTcpCSM(16, true).getMaxOutboundPayloadSize()); assertEquals(512, new CoapTcpCSM(600, true).getMaxOutboundPayloadSize()); assertEquals(1024, new CoapTcpCSM(1200, true).getMaxOutboundPayloadSize()); assertEquals(1024, new CoapTcpCSM(2000, true).getMaxOutboundPayloadSize()); assertEquals(1024, new CoapTcpCSM(3000, true).getMaxOutboundPayloadSize()); assertEquals(2048, new CoapTcpCSM(4000, true).getMaxOutboundPayloadSize()); assertEquals(3072, new CoapTcpCSM(5000, true).getMaxOutboundPayloadSize()); assertEquals(4096, new CoapTcpCSM(6000, true).getMaxOutboundPayloadSize()); }