* * *

|  [ **Overview** ](../../../overview-summary.html) |  [ **Package** ](package-summary.html) |  **Class** |  [ **Use** ](class-use/IsSame.html) |  [ **Tree** ](package-tree.html) |  [ **Deprecated** ](../../../deprecated-list.html) |  [ **Index** ](../../../index-all.html) |  [ **Help** ](../../../help-doc.html)  
---|---|---|---|---|---|---|---  
__  
[ **PREV CLASS** ](../../../org/hamcrest/core/IsNull.html "class in org.hamcrest.core") [ **NEXT CLASS** ](../../../org/hamcrest/core/StringContains.html "class in org.hamcrest.core") |  [ **FRAMES** ](../../../index.html?org/hamcrest/core/IsSame.html) [ **NO FRAMES** ](IsSame.html) [ **All Classes** ](../../../allclasses-noframe.html)  
SUMMARY: NESTED | FIELD |  CONSTR  |  METHOD  |  DETAIL: FIELD |  CONSTR  |  METHOD   
  
* * *

##  org.hamcrest.core  
Class IsSame<T>

    
    
    java.lang.Object
      ![extended by ](../../../resources/inherit.gif)[org.hamcrest.BaseMatcher](../../../org/hamcrest/BaseMatcher.html "class in org.hamcrest")<T>
          ![extended by ](../../../resources/inherit.gif)**org.hamcrest.core.IsSame <T>**
    

**All Implemented Interfaces:**      [ Matcher
](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <T>, [
SelfDescribing ](../../../org/hamcrest/SelfDescribing.html "interface in
org.hamcrest")

* * *
    
    
    public class **IsSame <T>**extends [BaseMatcher](../../../org/hamcrest/BaseMatcher.html "class in org.hamcrest")<T>

Is the value the same object as another value?

* * *

**Constructor Summary**  
---  
` **[ IsSame ](../../../org/hamcrest/core/IsSame.html#IsSame\(T\)) ** ( [ T
](../../../org/hamcrest/core/IsSame.html "type parameter in IsSame") object) `  
  
**Method Summary**  
---  
` void ` |  ` **[ describeTo ](../../../org/hamcrest/core/IsSame.html#describeTo\(org.hamcrest.Description\)) ** ( [ Description ](../../../org/hamcrest/Description.html "interface in org.hamcrest") description) `   
Generates a description of the object.  
` boolean ` |  ` **[ matches ](../../../org/hamcrest/core/IsSame.html#matches\(java.lang.Object\)) ** (java.lang.Object arg) `   
Evaluates the matcher for argument  item  .  
` static  |  ` <T> [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <T> `  
---  
` ` **[ sameInstance
](../../../org/hamcrest/core/IsSame.html#sameInstance\(T\)) ** (T target) `  
Creates a matcher that matches only when the examined object is the same
instance as the specified target object.  
` static  |  ` <T> [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <T> `  
---  
` ` **[ theInstance ](../../../org/hamcrest/core/IsSame.html#theInstance\(T\))
** (T target) `  
Creates a matcher that matches only when the examined object is the same
instance as the specified target object.  
**Methods inherited from class org.hamcrest.[ BaseMatcher
](../../../org/hamcrest/BaseMatcher.html "class in org.hamcrest") **  
---  
` [ _dont_implement_Matcher___instead_extend_BaseMatcher_
](../../../org/hamcrest/BaseMatcher.html#_dont_implement_Matcher___instead_extend_BaseMatcher_\(\))
, [ describeMismatch
](../../../org/hamcrest/BaseMatcher.html#describeMismatch\(java.lang.Object,
org.hamcrest.Description\)) , [ toString
](../../../org/hamcrest/BaseMatcher.html#toString\(\)) `  
**Methods inherited from class java.lang.Object**  
---  
` clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait,
wait `  
  
**Constructor Detail**  
---  
  
###  IsSame

    
    
    public **IsSame**([T](../../../org/hamcrest/core/IsSame.html "type parameter in IsSame") object)

**Method Detail**  
---  
  
###  matches

    
    
    public boolean **matches**(java.lang.Object arg)

     **Description copied from interface:` [ Matcher ](../../../org/hamcrest/Matcher.html#matches\(java.lang.Object\)) ` **
     Evaluates the matcher for argument  item  . 

This method matches against Object, instead of the generic type T. This is
because the caller of the Match