Here you can find the source of addIfNotContained(List list, Object object)
@SuppressWarnings("unchecked") public static void addIfNotContained(List list, Object object)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { @SuppressWarnings("unchecked") public static void addIfNotContained(List list, Object object) { if (!list.contains(object)) { list.add(object);/* www . j a v a 2 s. co m*/ } } }