Prototype implementation in Java