anchor.diff:  |
   |===
   
  +[[Groovy3.0releasenotes-GDKimprovements]]
  +== GDK improvements
  +
  +Groovy adds many extension methods to existing Java classes. In Groovy 3, about 80 new such extension methods were added.
  +We highlight just a few here:
  +
  +=== `average()` on arrays and iterables
  +
  +[source,groovy]
  +--------------------------------------
  +assert 3 == [1, 2, 6].average()
  +--------------------------------------
  +
  +=== `takeBetween()` on Strings, CharSequences and GStrings
  +
  +[source,groovy]
  +--------------------------------------
  +assert 'Groovy'.takeBetween( 'r', 'v' ) == 'oo'
  +--------------------------------------
  +
  +=== `shuffle()` and `shuffled()` on arrays and iterables
  +
  +[source,groovy]
  +--------------------------------------
  +def orig = [1, 3, 5, 7]
  +def mixed = orig.shuffled()
  +assert mixed.size() == orig.size()
  +assert mixed.toString() ==~ /\[(\d, ){3}\d\]/
  +--------------------------------------
  +
  +=== `collect{ }` on `Future`
  +
  +[source,groovy]
  +--------------------------------------
  +Future<String> foobar = executor.submit{ "foobar" }
  +Future<Integer> foobarSize = foobar.collect{ it.size() } // async
  +assert foobarSize.get() == 6
  +--------------------------------------
  +
  +=== `minus()` on `LocalDate`
  +
  +[source,groovy]
  +--------------------------------------
  +def xmas = LocalDate.of(2019, Month.DECEMBER, 25)
  +def newYear = LocalDate.of(2020, Month.JANUARY, 1)
  +assert newYear - xmas == 7 // a week apart
  +--------------------------------------
  +
   [[Groovy3.0releasenotes-Miscimprovements]]
   == Miscellaneous improvements
   
  
positive.code: 
  [width="80%",align="center"]
  |===
  a| NOTE: _Experimental Status:_ While this feature will remain, we regard its current implementation as experimental.
  Currently, interface default methods are implemented using traits. This means that they work even when using JDK7
  (i.e. using Groovy 2.6 with Parrot parser enabled on a version 7 JRE).
  We are currently exploring supporting native default methods in interfaces instead of, or in addition to,
  the trait implementation. If we change the implementation, we would expect no change in logical behavior
  though the new implementation may have different performance characteristics in some circumstances and the
  native implementation would only work on JDK8+.
  Our goal is to clarify this aspect of the language before reaching release candidate status.
  |===
  
  [[Groovy3.0releasenotes-Splitpackages]]
  
negative.code: assert null == personInfo?['name']
  --------------------------------------
  
  === "var" reserved type
  
  Groovy supports a `def` type placeholder.
  It can be used with fields, local variables and methods.
  In dynamic Groovy, you use `def` when the type of the field or local variable (or return type for methods)
  is deemed not important at compile time - normal runtime typing still applies.
  For static Groovy, it is used when type inference is preferred over an explicit type.
  
  In Groovy 3.0, a new type placeholder is available: `var`.
  It provides the syntax equivalent of Java 10's `var` reserved type (but you can use it with Groovy 3 from JDK 8).
  It can be used for fields and local variables and can be considered an alias for `def`.
  
  [width="80%",align="center"]
  |===
  a| NOTE: _Incubating Status:_ Using `var` with `@CompileStatic` is regarded as an incubating feature.
  Currently it is a direct alias for `def` which means in that scenario, type inference will be available
  which yields similar behavior to Java in most cases.
  Groovy's behavior does differ from Java in cases involving flow typing.
  The _incubating_ status indicates that we reserve the right to change the behavior for these flow typing cases.
  While some users have expressed the desire for a behavior closer to Java when `var` is used with `@CompileStatic` and flow typing,
  we currently don't think the extra complexity in changing behavior is warranted.
  We are however still exploring possibilities in this area.
  |===
  
  === ARM Try with resources
  
  Groovy often provides better alternatives to Java 7's `try`-with-resources statement for Automatic Resource Management (ARM).
  