private <R> void testFirstDefinedValueConfig(R value1, R value2,
            Function<ConfigFunction<FieldScope, R>, SchemaGeneratorConfigPart<FieldScope>> addConfig,
            ConfigFunction<FieldScope, R> resolveValue) {
        Assertions.assertNull(resolveValue.apply(this.field1));

        Assertions.assertSame(this.instance, addConfig.apply(member -> member == this.field1 ? value1 : null));
        Assertions.assertEquals(value1, resolveValue.apply(this.field1));
        Assertions.assertNull(resolveValue.apply(this.field2));

        Assertions.assertSame(this.instance, addConfig.apply(member -> member == this.field1 ? value2 : null));
        Assertions.assertEquals(value1, resolveValue.apply(this.field1));
        Assertions.assertNull(resolveValue.apply(this.field2));
        Assertions.assertNull(resolveValue.apply(this.field3));

        Assertions.assertSame(this.instance, addConfig.apply(member -> member == this.field2 ? value2 : null));
        Assertions.assertEquals(value1, resolveValue.apply(this.field1));
        Assertions.assertEquals(value2, resolveValue.apply(this.field2));
        Assertions.assertNull(resolveValue.apply(this.field3));
    }
Test for the {@link SchemaGeneratorConfigPart} class.
jsonschema-generator/src/test/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfigPartTest.java