Java implementation

Hi there, I've created a simple Java implementation based on the PHP implementation.