Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mockito.internal.util.collections
Class HashCodeAndEqualsMockWrapper

    java.lang.Object
      org.mockito.internal.util.collections.HashCodeAndEqualsMockWrapper

    public class HashCodeAndEqualsMockWrapper

extends java.lang.Object

hashCode and equals safe mock wrapper.

It doesn't use the actual mock `Object.hashCode()` and `Object.equals(java.lang.Object)` method as they might throw an NPE if those method cannot be stubbed even internally.

Instead the strategy is :

- For hashCode : use `System.identityHashCode(java.lang.Object)`
- For equals : use the object reference equality

See Also:
  `HashCodeAndEqualsSafeSet`

Constructor Summary
`HashCodeAndEqualsMockWrapper(java.lang.Object mockInstance)`

Method Summary
`boolean` | `equals(java.lang.Object o)`
`java.lang.Object` | `get()`
`int` | `hashCode()`
`static HashCodeAndEqualsMockWrapper` | `of(java.lang.Object mock)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### HashCodeAndEqualsMockWrapper

    public HashCodeAndEqualsMockWrapper(java.lang.Object mockInstance)

Method Detail

### get

    public java.lang.Object get()

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### of

    public static HashCodeAndEqualsMockWrapper of(java.lang.Object mock)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD