1 /* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 6 package org.mockito.internal.matchers; 7 8 import org.mockito.ArgumentMatcher; 9 import org.mockito.internal.matchers.text.ValuePrinter; 10 11 import java.io.Serializable; 12 13 public class Same implements ArgumentMatcher<Object>, Serializable { 14 15 private final Object wanted; 16 Same(Object wanted)17 public Same(Object wanted) { 18 this.wanted = wanted; 19 } 20 matches(Object actual)21 public boolean matches(Object actual) { 22 return wanted == actual; 23 } 24 toString()25 public String toString() { 26 return "same(" + ValuePrinter.print(wanted) + ")"; 27 } 28 } 29