org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-core Show documentation
Show all versions of mockito-core Show documentation
Mockito mock objects library core API and implementation
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.util.collections;
import static java.lang.reflect.Array.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.mockito.internal.util.Checks;
/**
* hashCode and equals safe hash based set.
*
*
* Useful for holding mocks that have un-stubbable hashCode or equals method,
* meaning that in this scenario the real code is always called and will most probably
* cause an {@link NullPointerException}.
*
*
* This collection wraps the mock in an augmented type {@link HashCodeAndEqualsMockWrapper}
* that have his own implementation.
*
*
* @see HashCodeAndEqualsMockWrapper
*/
public class HashCodeAndEqualsSafeSet implements Set