anchor.diff:  }
   --------------------------------------
   
  -==== Java-inspired changes (under investigation)
  -
  -The following are being explored as candidate changes for Groovy 4:
  -
  -* Switch expressions
  -link:https://openjdk.java.net/jeps/354[JEP 354: Switch Expressions (Second Preview)]
  -link:https://openjdk.java.net/jeps/361[JEP 361: Switch Expressions]
  +An example of guarded patterns being considered for Java:
  +
  +[source,java]
  +--------------------------------------
  +static void testTriangle(Shape s) {
  +    switch (s) {
  +        case null ->
  +            System.out.println("Null!");
  +        case Triangle t && (t.calculateArea() > 100) ->
  +            System.out.println("Large triangle");
  +        case Triangle t ->
  +            System.out.println("Small triangle");
  +        default ->
  +            System.out.println("Non-triangle");
  +    }
  +}
  +--------------------------------------
  +
  +Another destructuring example:
  +
  +[source,java]
  +--------------------------------------
  +int eval(Expr n) {
  +     return switch(n) {
  +         case IntExpr(int i) -> i;
  +         case NegExpr(Expr n) -> -eval(n);
  +         case AddExpr(Expr left, Expr right) -> eval(left) + eval(right);
  +         case MulExpr(Expr left, Expr right) -> eval(left) * eval(right);
  +         default -> throw new IllegalStateException();
  +     };
  +}
  +--------------------------------------
  +
  +We should consider the currently proposed nested record pattern when exploring our
  +destructuring options, e.g.:
  +
  +[source,java]
  +--------------------------------------
  +static void printColorOfUpperLeftPoint(Rectangle r) {
  +    if (r instanceof Rectangle(ColoredPoint(Point p, Color c), ColoredPoint lr)) {
  +        System.out.println(c);
  +    }
  +}
  +--------------------------------------
  +
  +=== Other Java-inspired enhancements
   
   * Module definitions written in Groovy (i.e. module-info.groovy)
   link:https://issues.apache.org/jira/browse/GROOVY-9273[GROOVY-9273]
  
positive.code: === Legacy package removal
  
  The Java Platform Module System (JPMS) requires that classes in distinct modules
  have distinct package names. Groovy has its own "modules" but these haven't
  historically been structured according to the above requirement.
  
  Groovy 3 provided duplicate versions of numerous classes (in old and new packages)
  to allow Groovy users to migrate towards the new JPMS compliant package names.
  See the link:http://groovy-lang.org/releasenotes/groovy-3.0.html#Groovy3.0releasenotes-Splitpackages[Groovy 3 release notes]
  for more details.
  In short, time to stop using `groovy.util.XmlSlurper` and start using `groovy.xml.XmlSlurper`.
  Similarly, you should now be using `groovy.xml.XmlParser`, `groovy.ant.AntBuilder`, `groovy.test.GroovyTestCase`
  and the other classes mentioned in the prior mentioned Groovy 3 release notes.
  
negative.code: |===
  a| NOTE: _WARNING:_
  Material on this page is still under development! +
  We are currently releasing beta versions of Groovy 4.0 with a goal
  of gathering feedback on the language changes from our community.
  In addition, early versions assist other projects and tool vendors within the
  Groovy ecosystem to begin assessing the impact of moving to/supporting Groovy 4.0.
  Caution should be exercised if using new features as the details may change before final release. +
  Some features described here as "incubating" may become stable before 4.0.0 final is released,
  others are expected to remain incubating for version 4.
  We don't recommend using beta versions or incubating features for production systems.
  |===
  
  
  