public class VmIssue {
    public static void main(String[] args) {
        new Factory1(new Factory1.Factory2() {
            @Override
            public void create(Factory1.Sink sink, Object o) {
                sink.add(() -> Factory3.create(null), null);
            }
        }).getF().create((f, o) -> {
            f.myCreate();
        }, null);
    }
}


interface FactoryIface<T> {
    public T myCreate();
}

class Factory1 {
    public static interface Sink {
        void add(FactoryIface<Iface1<Object>> f, Object o);
    }

    public static interface Factory2 {
        void create(Sink sink, Object o);

    }
    private Factory2 f;

    public Factory1(Factory2 f) {
        this.f = f;
    }

    public Factory2 getF() {
        return f;
    }
}

interface Iface1<T> {
}

class MyClass {
}

class Factory3 implements Iface1<Object>  {
    public static Factory3 create(MyClass o) {
        return new Factory3(new MyClass2(o), () -> new FactoryIface<Object>() {
            @Override
            public Object myCreate() {
                return null;
            }
        });
    }
    private Factory3(Iface1<Object> iface, FactoryIface<FactoryIface<Object>> factoriesFactory) {
    }

}

class MyClass2 implements Iface1<Object> {
    private MyClass obj;

    public MyClass2(MyClass obj) {
        this.obj = obj;
    }
}