Here you can find the source of containsInEach(List
Parameter | Description |
---|---|
first | the first |
second | the second |
public static boolean containsInEach(List<String> first, List<String> second)
//package com.java2s; /*/*from w w w .java2 s.co m*/ * CollectionUtil.java * Copyright (c) 2014, CODEROAD, All Rights Reserved. * * This software is the confidential and proprietary information of CODEROAD * ("Confidential Information"). You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you entered into with * CODEROAD. */ import java.util.List; public class Main { /** * Contains in each. * * @param first the first * @param second the second * @return true, if successful */ public static boolean containsInEach(List<String> first, List<String> second) { for (String value : second) { if (!first.contains(value)) { return false; } } return true; } }