void testValidForAppend() {
        if (_size == 0 || _size > 1 && _bytes[_size - 1] == 0 || _inKeyCoder)
            return;

        int b = _bytes[_size - 1] & 0xFF;
        if (_size == 1) {
            if (b == TYPE_LEFT_EDGE) {
                throw new IllegalArgumentException("append to LEFT_EDGE key");
            }
            if (b == TYPE_RIGHT_EDGE) {
                throw new IllegalArgumentException("append to RIGHT_EDGE key");
            }
        }
        if (b == TYPE_BEFORE || b == TYPE_AFTER) {
            throw new IllegalArgumentException("append to BEFORE key or AFTER");
        } else {
            throw new IllegalArgumentException("append to invalid final key segment: " + (b & 0xFF));
        }
    }