Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Bean two with handcrafted comparison
package delegation
import groovy.transform.TupleConstructor
class BeanTwo implements Comparable<BeanTwo> {
int yob
public int getAge() {
new Date().year - yob
int compareTo(BeanTwo o) {
if (!o) return false
if ( return false
return age <=> o.age
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment