code: private void insert(E master, E current) {
  		Collection<E> dependencies = getDependencies(current);
  		for (E item : dependencies) {
  			if (item.equals(master)) {
  				generateError(master);
  			}
  			insert(master, item);
  		}
  
  		// insert only element does not exists
  		if (output.indexOf(current)==-1)
  		{		
  			output.add(current);
  		}
  	}
docs: Insert.
  
  @param master the master
  @param current the current