package de.tse.beanrepository;

import java.util.function.Function;

class SingletonProvider implements BeanProvider {

    private final Function<BeanRepository, ?> creator;
    private Object instance;

    SingletonProvider(final Function<BeanRepository, ?> creator) {
        this.creator = creator;
    }

    @Override public <T> T getBean(final BeanRepository repository, final boolean dryRun) {
        if (instance == null) {
            instance = creator.apply(repository);
            new PostConstructor(repository).postConstruct(instance, dryRun);
        }
        return (T) instance;
    }
}

@@ -440,17 +440,34 @@
         
-i
+final Object beanI
 nstance 
@@ -553,17 +553,21 @@
 nstruct(
-i
+beanI
 nstance,
@@ -576,16 +576,135 @@
 ryRun);%0A
+            if (!dryRun) %7B%0A                instance = beanInstance;%0A            %7D%0A            return (T) beanInstance;%0A
         

Fix dryRun for Singletons