@@ -0,0 +1,1974 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.commons.collections.functors;%0A%0A/**%0A * Default %7B@link Equator%7D implementation.%0A * %0A * @param %3CT%3E%0A * @since Commons Collections 4.0%0A * @version $Revision$ $Date$%0A */%0Apublic class DefaultEquator%3CT%3E implements Equator%3CT%3E %7B%0A%09/** Static instance */%0A%09public static final DefaultEquator%3CObject%3E INSTANCE = new DefaultEquator%3CObject%3E();%0A%0A%09/**%0A%09 * Hashcode used for %3Ccode%3Enull%3C/code%3E objects.%0A%09 */%0A%09public static final int HASHCODE_NULL = -1;%0A%0A%09/**%0A%09 * %7B@inheritDoc%7D Delegates to %7B@link Object#equals(Object)%7D.%0A%09 */%0A%09public boolean equate(T o1, T o2) %7B%0A%09%09return o1 == o2 %7C%7C o1 != null && o1.equals(o2);%0A%09%7D%0A%0A%09/**%0A%09 * %7B@inheritDoc%7D%0A%09 * %0A%09 * @return %3Ccode%3Eo.hashCode()%3C/code%3E if %3Ccode%3Eo%3C/code%3E is non-%0A%09 *         %3Ccode%3Enull%3C/code%3E, else %7B@link #HASHCODE_NULL%7D.%0A%09 */%0A%09public int hash(T o) %7B%0A%09%09return o == null ? HASHCODE_NULL : o.hashCode();%0A%09%7D%0A%0A%09private Object readResolve() %7B%0A%09%09return INSTANCE;%0A%09%7D%0A%0A%09/**%0A%09 * Get a typed %7B@link DefaultEquator%7D instance.%0A%09 * %0A%09 * @param %3CT%3E%0A%09 * @return %7B@link DefaultEquator#INSTANCE%7D%0A%09 */%0A%09@SuppressWarnings(%22unchecked%22)%0A%09public static %3CT%3E DefaultEquator%3CT%3E instance() %7B%0A%09%09return (DefaultEquator%3CT%3E) DefaultEquator.INSTANCE;%0A%09%7D%0A%7D%0A

add default Equator implementation