public List<BeanDefinition> sort() {
        List<Class<?>> allTypes = getTypesFrom(beans);
        List<BeanDefinition> sortedBeans = new ArrayList<>();
        assertAllSatisfiable(beans, allTypes);
        List<Holder> holders = getGreedyConstructorsFrom(beans, allTypes);
        Iterator<Holder> iter = holders.iterator();
        while(iter.hasNext()){
            Holder holder = iter.next();
            if(holder.bean.canInstantiate()) {
                sortedBeans.add(holder.bean);
                iter.remove();
            }
        }
        int i = 0;

        while(!holders.isEmpty()) {
            List<Class<?>> currentlyReady = getTypesFrom(sortedBeans);
            if( i >= holders.size() ) {
                i = 0;
            }
            Holder holder = holders.get(i);

            if(holder.bean.getConstructorModel().findBestConstructorsForTypes(currentlyReady, holder.bean.getConstructorArgs() ) != null || holder.bean.canInstantiate()) {
                sortedBeans.add(holder.bean);
                holders.remove(i);
            }
            i++;
        }
        return sortedBeans;
    }