### Question:
VirtualPropertiesWriter extends VirtualBeanPropertyWriter { @Override public VirtualPropertiesWriter withConfig(MapperConfig<?> config, AnnotatedClass declaringClass, BeanPropertyDefinition propDef, JavaType type) { return new VirtualPropertiesWriter( propDef, new AnnotationCollector.OneAnnotation( declaringClass.getRawType(), declaringClass.getAnnotations().get(JsonAppend.class) ), type, virtualProperties, valueResolver, filters ); } VirtualPropertiesWriter();  VirtualPropertiesWriter(VirtualProperty[] virtualProperties, ValueResolver valueResolver);  VirtualPropertiesWriter(VirtualProperty[] virtualProperties, ValueResolver valueResolver, VirtualPropertyFilter[] filters); @Deprecated  VirtualPropertiesWriter(
            BeanPropertyDefinition propDef,
            Annotations annotations,
            JavaType type,
            VirtualProperty[] virtualProperties,
            ValueResolver valueResolver
    );   VirtualPropertiesWriter(
            BeanPropertyDefinition propDef,
            Annotations annotations,
            JavaType type,
            VirtualProperty[] virtualProperties,
            ValueResolver valueResolver,
            VirtualPropertyFilter[] filters
    ); @Override void serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov); @Override VirtualPropertiesWriter withConfig(MapperConfig<?> config, AnnotatedClass declaringClass, BeanPropertyDefinition propDef, JavaType type); @Override void fixAccess(SerializationConfig config);  }### Answer:
@Test public void withConfigReturnsConfiguredWriter() { ObjectMapper objectMapper = new ObjectMapper(); SerializationConfig config = objectMapper.getSerializationConfig(); VirtualPropertiesWriter writer = spy(new VirtualPropertiesWriter( new VirtualProperty[0], mock(ValueResolver.class), new VirtualPropertyFilter[0] )); JavaType javaType = config.constructType(LogEvent.class); AnnotatedClass annotatedClass = createTestAnnotatedClass(config, javaType); SimpleBeanPropertyDefinition simpleBeanPropertyDefinition = getTestBeanPropertyDefinition(config, javaType, annotatedClass); VirtualPropertiesWriter result = writer.withConfig( config, annotatedClass, simpleBeanPropertyDefinition, config.constructType(VirtualProperty.class) ); assertArrayEquals(writer.virtualProperties, result.virtualProperties); assertEquals(writer.valueResolver, result.valueResolver); assertEquals(writer.filters, result.filters); }