### Question:
AtomicBuffer { public void checkLimit(final int limit) { if (limit > capacity) { final String msg = String.format("limit=%d is beyond capacity=%d", Integer.valueOf(limit), Integer.valueOf(capacity)); throw new IndexOutOfBoundsException(msg); } } AtomicBuffer(final byte[] buffer);  AtomicBuffer(final ByteBuffer buffer);  AtomicBuffer(final long address, final int capacity); void wrap(final byte[] buffer); void wrap(final ByteBuffer buffer); void wrap(final long address, final int capacity); byte[] array(); ByteBuffer byteBuffer(); int capacity(); void checkLimit(final int limit); ByteBuffer duplicateByteBuffer(); long getLong(final int index); long getLong(final int index, final ByteOrder byteOrder); void putLong(final int index, final long value); void putLong(final int index, final long value, final ByteOrder byteOrder); long getLongVolatile(final int index); void putLongOrdered(final int index, final long value); long getAndAddLong(final int index, final long delta); boolean compareAndSwapLong(final int index, final long expectedValue, final long updatedValue); int getInt(final int index); int getInt(final int index, final ByteOrder byteOrder); void putInt(final int index, final int value); void putInt(final int index, final int value, final ByteOrder byteOrder); int getIntVolatile(final int index); void putIntOrdered(final int index, final int value); double getDouble(final int index, final ByteOrder byteOrder); void putDouble(final int index, final double value, final ByteOrder byteOrder); float getFloat(final int index, final ByteOrder byteOrder); void putFloat(final int index, final float value, final ByteOrder byteOrder); short getShort(final int index, final ByteOrder byteOrder); void putShort(final int index, final short value, final ByteOrder byteOrder); byte getByte(final int index); void putByte(final int index, final byte value); int getBytes(final int index, final byte[] dst); int getBytes(final int index, final byte[] dst, final int offset, final int length); int getBytes(final int index, final ByteBuffer dstBuffer, final int length); int getBytes(final int index, final AtomicBuffer dst, final int offset, final int length); int putBytes(final int index, final byte[] src); int putBytes(final int index, final byte[] src, final int offset, final int length); int putBytes(final int index, final ByteBuffer srcBuffer, final int length); int putBytes(final int index, final AtomicBuffer src, final int offset, final int length); void setMemory(final int index, final int length, final byte value);  }### Answer:
@Theory @Test(expected = IndexOutOfBoundsException.class) public void shouldThrowExceptionForLimitAboveCapacity(final AtomicBuffer buffer) { final int position = BUFFER_CAPACITY + 1; buffer.checkLimit(position); }