How does gradle copy task handle two source files where destination location overlaps?

Assuming you map two source directories to the same copy location, what happens when there are files with identical names in both source dirs. Which file will end up in the destination? Can you control this behavior?

I found the answer here, as long as it is still valid …

http://stackoverflow.com/questions/12319756/gradle-copy-task-how-to-overwrite-existing-files

It has changed. New capabilities were added in 1.7:

http://www.gradle.org/docs/1.7/release-notes#duplicate-file-handling-for-copy-and-archive-operations

And improved in 1.8:

http://www.gradle.org/docs/1.8/release-notes#new-duplicate-file-handling-strategies