Java implementations of some of the algorithms and examples in a couple of books I have read about cryptography:
-
Christof Paar and Jan Pelzl: Understanding cryptography
-
Jonathan Katz and Yehuda Lindell: Introduction to modern cryptography, 2nd ed.