public synchronized boolean hasStartOfBlock() {
        return startOfBlockIndex >= 0;
    }
@Test
    public void testHasStartOfBlock() {
        assertFalse(instance.hasStartOfBlock(), "Unexpected initial value");

        instance.write(MllpProtocolConstants.START_OF_BLOCK);
        assertTrue(instance.hasStartOfBlock());

        instance.reset();
        assertFalse(instance.hasStartOfBlock());

        instance.write(TEST_HL7_MESSAGE.getBytes());
        assertFalse(instance.hasStartOfBlock());

        instance.write(MllpProtocolConstants.START_OF_BLOCK);
        assertTrue(instance.hasStartOfBlock());

        instance.write(TEST_HL7_MESSAGE.getBytes());
        assertTrue(instance.hasStartOfBlock());
    }