concept return type in category groovy

This is an excerpt from Manning's book Groovy in Action, Second Edition.
By this means, you can easily find out which methods you can call on the object you’re currently working on (same intent as code completion in IDEs), which type declared that method, and whether it comes from Groovy or Java. Let’s try this out: click the Name header to sort by method names, then click Declarer, then click Origin. Now scroll down the list until you see Object as the declarer. Now you should see the same as in figure 1.6: the list of all methods, including parameter types and return type, that Groovy adds to java.lang.Object. You’ll learn more about these methods in chapter 12.
Closures are very similar to methods: they’re blocks of code that can accept parameters and return values. When it comes to type checking, however, there’s a big difference between a method and a closure: while in the first one the signature is declared explicitly, for closures, the return type is implicit and arguments are optional. Moreover, what gives the closures their name is the fact that they’re able to capture local variables and references from the enclosing scope. Let’s examine these differences in more detail.
Internally, the least upper bound is also used to compute the inferred return type of a method or a closure. For that, the type checker collects all return expressions (both explicit, using the return keyword, and implicit, without return) and compares their inferred type to the declared method return type. If any of the return statement isn’t compatible with the return type, an error is thrown. If, as expected, all returns are compatible, the inferred return type of the method is computed as the least upper bound of all returns.