Mascot 2 implementation in Java