@Override
    @Nullable
    public IdentifiedDataSerializable create(int typeId) {
        if (typeId >= 0 && typeId < len) {
            Supplier<IdentifiedDataSerializable> factory = constructors[typeId];
            return factory != null ? factory.get() : null;
        }
        return null;
    }
@Test
    public void testCreate() {
        Supplier<IdentifiedDataSerializable>[] constructorFunctions = new Supplier[1];

        constructorFunctions[0] = () -> new SampleIdentifiedDataSerializable();

        ArrayDataSerializableFactory factory = new ArrayDataSerializableFactory(constructorFunctions);

        assertNull(factory.create(-1));
        assertNull(factory.create(1));
        assertThat(factory.create(0)).isInstanceOf(SampleIdentifiedDataSerializable.class);
    }