Twig port to Java