Provider recursion question
So, I have class `Bar` that should contains factory of Bars. 

    class Bar {
        Collection<Bar> childs;
        Bar(BarFactory factory, Foo1 foo, Foo2 foo2){
            
        }
        addChild(Foo1 foo1){
             childs.add(factory.create(foo1));
        }
    }
    class BarFactory {
        Bar create(Foo1 foo1);
    }

The problem in describing BarFactory. There are specific logic with dependencies from other objects. I've tried to use `@Provides` mechanism, like

    @Provides
    BarFactory provideLogicElementPresenterFactory(Dependence d){
        final BarFactory f = new BarFactory(){  
            @Override
            public Bar create(Foo1 foo1) {
                Foo2 foo2 = null;//some logic
                return new Bar(/*how pass factory here?*/f, foo1, foo2);
            }
        };
        return f;
    }
How to describe such recursive structure or there is alternative solution for this issue?

Provider recursion question
===

So, I have class `Bar` that should contains factory of Bars. 

    class Bar {
        Collection<Bar> childs;
        Bar(BarFactory factory, Foo1 foo, Foo2 foo2){
            
        }
        addChild(Foo1 foo1){
             childs.add(factory.create(foo1));
        }
    }
    class BarFactory {
        Bar create(Foo1 foo1);
    }

The problem in describing BarFactory. There are specific logic with dependencies from other objects. I've tried to use `@Provides` mechanism, like

    @Provides
    BarFactory provideLogicElementPresenterFactory(Dependence d){
        final BarFactory f = new BarFactory(){  
            @Override
            public Bar create(Foo1 foo1) {
                Foo2 foo2 = null;//some logic
                return new Bar(/*how pass factory here?*/f, foo1, foo2);
            }
        };
        return f;
    }
How to describe such recursive structure or there is alternative solution for this issue?
