OSS repositories abound. Just pick your favorite bits of open-source and study the code that makes it all go! There's a lot to be learned by studying the source code. Even more by pulling it local and running it. Make a few changes and experiment with it. Most will come with automated tests. Go ahead and make up a few of your own.
They've got all the info out there on how to get the source code locally and a bunch of other info here if you need: