Here you can find the source of listHasIdentContent(List list_1, List list_2)
@SuppressWarnings("rawtypes") public static boolean listHasIdentContent(List list_1, List list_2)
//package com.java2s; /************************************************************************ * Copyright (c) 2014 IoT-Solutions e.U. * //from www . j a v a 2 s.c om * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ************************************************************************/ import java.util.List; import java.util.ListIterator; public class Main { @SuppressWarnings("rawtypes") public static boolean listHasIdentContent(List list_1, List list_2) { if (list_1 == list_2) return true; if (list_1.size() != list_2.size()) return false; ListIterator<?> e1 = list_1.listIterator(); ListIterator<?> e2 = list_2.listIterator(); while (e1.hasNext() && e2.hasNext()) { Object o1 = e1.next(); Object o2 = e2.next(); if (o1 != o2) return false; } return true; } }