Cleaned up some test code debt, moved over a couple of unit tests from DefaultProjectTest. I need that for a next change I'm planning to do.
Moved some complexity out of the DefaultConfiguration and the test into separate classes for better clarity and testability. This will allow to make some other changes I'm planning on doing.
Avoided some ordering issues with collection assertions.
Fixed GRADLE-3067. Configuration.getTaskDependencyFromProjectDependency API was not coping very well with configure-on-demand mode.

I've fixed it in a simplest possible way - by invoking an explicit 'evaluate' on the target projects. It's not very clean and I was hesitant to do it, especially as I don't know the future of getTaskDependencyFromProjectDependency API (I would love to get rid of it). Eventually, I decided that fixing it will make Gradle better. Plus the changes has driven some cleanup in the test code and refactorings that pushed complexity out of DefaultConfiguration.

Down the road when we work full speed at new configuration model it should be easy to spot all the places where we explicitly configure projects and deal with them in more desirable way.