A simple, generic implementation of Markov chains in Java