Here you can find the source of equalsBasedOnEntryIdentity(final List
public static <T> boolean equalsBasedOnEntryIdentity(final List<T> a, final List<T> b)
//package com.java2s; /****************************************************************************** * Copyright (c) 2015 Oracle and Liferay * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w. j a v a2s . co m*/ * Konstantin Komissarchik - initial implementation and ongoing maintenance * Gregory Amerson - [358295] Need access to selection in list property editor ******************************************************************************/ import java.util.List; public class Main { public static <T> boolean equalsBasedOnEntryIdentity(final List<T> a, final List<T> b) { if (a == b) { return true; } if (a == null || b == null) { return false; } final int aSize = a.size(); final int bSize = b.size(); if (aSize == bSize) { for (int i = 0; i < aSize; i++) { if (a.get(i) != b.get(i)) { return false; } } return true; } return false; } }