@Test
    public void testIt()
    {
        try
        {
            DefaultIdStrategy idStrategy = new DefaultIdStrategy(
                    IdStrategy.DEFAULT_FLAGS | IdStrategy.COLLECTION_SCHEMA_ON_REPEATED_FIELDS);
            idStrategy.registerDelegate(new ProtobufCalendar());

            ClassThrowNpeWhenDeserializing originMsg = new ClassThrowNpeWhenDeserializing();
            originMsg.value = new ArrayList<Calendar[]>();
            Calendar[] vArray = new Calendar[1];
            vArray[0] = Calendar.getInstance();
            originMsg.value.add(vArray);

            Schema<ClassThrowNpeWhenDeserializing> schema = RuntimeSchema.getSchema(
                    ClassThrowNpeWhenDeserializing.class, idStrategy);
            byte[] bytes = ProtobufIOUtil.toByteArray(originMsg, schema,
                    LinkedBuffer.allocate(512));
            ClassThrowNpeWhenDeserializing msg = schema.newMessage();
            ProtobufIOUtil.mergeFrom(bytes, msg, schema);

            Assert.assertEquals(1, originMsg.value.size());
            Assert.assertEquals(1, msg.value.size());
            Assert.assertEquals(1, originMsg.value.get(0).length);
            Assert.assertEquals(1, msg.value.get(0).length);
            Assert.assertEquals(originMsg.value.get(0)[0], msg.value.get(0)[0]);
        }
        catch (NullPointerException e)
        {
            e.printStackTrace();
            Assert.fail();
        }
    }
Test for #issue336

@author rxh
@created Jul 21, 2022
protostuff-runtime/src/test/java/io/protostuff/runtime/ArrayItemHasDelegateThrowNpeWhenDeserializingTest.java