Here you can find the source of containsOneEqualElem(List first, List second)
Parameter | Description |
---|---|
first | first list |
second | second list to compare |
public static boolean containsOneEqualElem(List first, List second)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**// w ww . j a va2s. c om * Test of a list contains one or more equal elements * * @param first first list * @param second second list to compare * * @return true if one or more elements are the same, false if lists are completely different */ public static boolean containsOneEqualElem(List first, List second) { for (Object str : first) { if (second.contains(str)) return true; } return false; } }