### Question:
JmsStreamMessage extends JmsMessage implements StreamMessage { @Override public void reset() throws JMSException { stream = null; index = 0; bytes = null; remainingBytes = -1; setReadOnlyBody(true); } JmsStreamMessage(JmsMessageFacade facade); @Override JmsMessage copy(); @Override void onSend(); @Override void clearBody(); @Override boolean readBoolean(); @Override byte readByte(); @Override short readShort(); @Override char readChar(); @Override int readInt(); @Override long readLong(); @Override float readFloat(); @Override double readDouble(); @Override String readString(); @Override int readBytes(byte[] value); @Override Object readObject(); @Override void writeBoolean(boolean value); @Override void writeByte(byte value); @Override void writeShort(short value); @Override void writeChar(char value); @Override void writeInt(int value); @Override void writeLong(long value); @Override void writeFloat(float value); @Override void writeDouble(double value); @Override void writeString(String value); @Override void writeBytes(byte[] value); @Override void writeBytes(byte[] value, int offset, int length); @Override void writeObject(Object value); @Override void reset(); @Override String toString();  }### Answer:
@Test public void testReset() throws JMSException { JmsStreamMessage streamMessage = factory.createStreamMessage(); try { streamMessage.writeDouble(24.5); streamMessage.writeLong(311); } catch (MessageNotWriteableException mnwe) { fail("should be writeable"); } streamMessage.reset(); try { assertTrue(streamMessage.isReadOnlyBody()); assertEquals(streamMessage.readDouble(), 24.5, 0); assertEquals(streamMessage.readLong(), 311); } catch (MessageNotReadableException mnre) { fail("should be readable"); } try { streamMessage.writeInt(33); fail("should throw exception"); } catch (MessageNotWriteableException mnwe) { } }