a java solution to the puddle puzzle

There seems to be a puzzle from Twitter getting some discussion.

gist

last update 2013-12-19