Home | History | Annotate | Download | only in collections
      1 /*
      2  * Copyright (c) 2007 Mockito contributors
      3  * This program is made available under the terms of the MIT License.
      4  */
      5 package org.mockito.internal.util.collections;
      6 
      7 import java.util.LinkedList;
      8 
      9 @SuppressWarnings("unchecked")
     10 public class IdentitySet {
     11 
     12     private final LinkedList list = new LinkedList();
     13 
     14     public boolean contains(Object o) {
     15         for(Object existing:list) {
     16             if (existing == o) {
     17                 return true;
     18             }
     19         }
     20         return false;
     21     }
     22 
     23     public void add(Object o) {
     24         list.add(o);
     25     }
     26 }
     27