@Test
    @SuppressWarnings("deprecation")
    public void testTargetTypeOverride() {
        ResolvedType type1 = Mockito.mock(ResolvedType.class);
        ResolvedType type2 = Mockito.mock(ResolvedType.class);
        ResolvedType type3 = Mockito.mock(ResolvedType.class);

        Assertions.assertNull(this.instance.resolveTargetTypeOverrides(this.field1));

        ConfigFunction<FieldScope, ResolvedType> resolver1 = member -> member == this.field1 ? type1 : null;
        Assertions.assertSame(this.instance, this.instance.withTargetTypeOverrideResolver(resolver1));
        Assertions.assertEquals(Collections.singletonList(type1), this.instance.resolveTargetTypeOverrides(this.field1));
        Assertions.assertNull(this.instance.resolveTargetTypeOverrides(this.field2));
        Assertions.assertNull(this.instance.resolveTargetTypeOverrides(this.field3));

        ConfigFunction<FieldScope, ResolvedType> resolver2 = member -> member == this.field1 ? type2 : null;
        Assertions.assertSame(this.instance, this.instance.withTargetTypeOverrideResolver(resolver2));
        Assertions.assertEquals(Collections.singletonList(type1), this.instance.resolveTargetTypeOverrides(this.field1));
        Assertions.assertNull(this.instance.resolveTargetTypeOverrides(this.field2));
        Assertions.assertNull(this.instance.resolveTargetTypeOverrides(this.field3));

        ConfigFunction<FieldScope, List<ResolvedType>> resolver3 = member -> member == this.field2 ? Arrays.asList(type2, type3) : null;
        Assertions.assertSame(this.instance, this.instance.withTargetTypeOverridesResolver(resolver3));
        Assertions.assertEquals(Collections.singletonList(type1), this.instance.resolveTargetTypeOverrides(this.field1));
        Assertions.assertEquals(Arrays.asList(type2, type3), this.instance.resolveTargetTypeOverrides(this.field2));
        Assertions.assertNull(this.instance.resolveTargetTypeOverrides(this.field3));
    }
Test for the {@link SchemaGeneratorConfigPart} class.
jsonschema-generator/src/test/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfigPartTest.java