Here's a great example of Brahms employing an old baroque compositional technique, namely, ripping off someone else's idea (and making it better).
The piece in question is the op. 38 E-minor Cello Sonata. The model is the Bernhard Romberg E-minor Cello Sonata, which many young cellists learn at some point in their education.
It seems that Brahms probably had encountered the Romberg in accompanying a cellist friend of his. Brahms had also learned some string bass as a child -- was there repertoire overlap in those days between cello and bass? a good Q.
Here's the Romberg:
[ame="http://www.youtube.com/watch?v=suV_wn4d6uQ"]http://www.youtube.com/watch?v=suV_wn4d6uQ[/ame]
If you listen closely to the very simple textures and harmonic progressions in the piano part, you don't need to exhaust your imagination to figure that Brahms was probably bored to tears. You can even imagine that he improvised ("improved," pun intended) on the accompaniment while playing.
Then, being a self-serving starving musician, decided to write up his own E-minor cello sonata and get it published. The result of which is the op. 38.
[ame="http://www.youtube.com/watch?v=cioQ1J8QoFA&feature=fvw"]http://www.youtube.com/watch?v=cioQ1J8QoFA&feature=fvw[/ame]
You can hear the similarity between the melodic lines of the first theme. (Yet notice the voice leading in the chords of the piano accompaniment, already more interesting, thanks.) There's also the triplet idea which Brahms takes in an entirely new direction. And of course the sonata is very much an exercise in development, even with its stolen thematic ideas. huzzah