public static void testBlock() { System.out.println(new Block<>((block) -> "Hello world!")); System.out.println(new Block<>((block) -> { returnFrom(block, "This should be returned"); return "This should not be returned"; })); } public static void testTagbody() { var ref = new Object() { boolean continueRunning = true; }; TagbodyTag tag1 = tag(), tag2 = tag(); TagbodyElement code1 = () -> { if (ref.continueRunning) { ref.continueRunning = false; go(tag1); } else { go(tag2); } }; tagbody(() -> System.out.println("Hello world!"), tag1, () -> System.out.println("This should get printed twice"), code1, () -> System.out.println("This will not get printed"), tag2, () -> System.out.println("Goodbye world!")); }