|
Groovy example source code file (CompareEqualsTest.groovy)
The Groovy CompareEqualsTest.groovy source codepackage groovy class CompareEqualsTest extends GroovyTestCase { void testEqualsOperatorIsMultimethodAware() { assert new Xyz() == new Xyz() assertEquals new Xyz(), new Xyz() shouldFail { assert new Xyz() == 239 } assert new Xyz () == "GROOVY.XYZ" } } class Xyz { boolean equals(Xyz other) { println "${other.class} TRUE" true } boolean equals(Object other) { println "${other.class} FALSE" null } boolean equals(String str) { str.equalsIgnoreCase this.class.getName() } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy CompareEqualsTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.