bool compare(bool isIdentityOnly, E first, E second) { if (isIdentityOnly == true) { return identical(first, second); } else { return equal(first, second); } }