* * *

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

##  org.hamcrest.collection  
Class IsCollectionWithSize<E>

    
    
    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.TypeSafeDiagnosingMatcher](../../../org/hamcrest/TypeSafeDiagnosingMatcher.html "class in org.hamcrest")<T>
              ![extended by ](../../../resources/inherit.gif)[org.hamcrest.FeatureMatcher](../../../org/hamcrest/FeatureMatcher.html "class in org.hamcrest")<java.util.Collection<? extends E>,java.lang.Integer>
                  ![extended by ](../../../resources/inherit.gif)**org.hamcrest.collection.IsCollectionWithSize <E>**
    

**All Implemented Interfaces:**      [ Matcher
](../../../org/hamcrest/Matcher.html "interface in org.hamcrest")
<java.util.Collection<? extends E>>, [ SelfDescribing
](../../../org/hamcrest/SelfDescribing.html "interface in org.hamcrest")

* * *
    
    
    public class **IsCollectionWithSize <E>**extends [FeatureMatcher](../../../org/hamcrest/FeatureMatcher.html "class in org.hamcrest")<java.util.Collection<? extends E>,java.lang.Integer>

Matches if collection size satisfies a nested matcher.

* * *

**Constructor Summary**  
---  
` **[ IsCollectionWithSize
](../../../org/hamcrest/collection/IsCollectionWithSize.html#IsCollectionWithSize\(org.hamcrest.Matcher\))
** ( [ Matcher ](../../../org/hamcrest/Matcher.html "interface in
org.hamcrest") <? super java.lang.Integer> sizeMatcher) `  
  
**Method Summary**  
---  
` protected java.lang.Integer ` |  ` **[ featureValueOf ](../../../org/hamcrest/collection/IsCollectionWithSize.html#featureValueOf\(java.util.Collection\)) ** (java.util.Collection<? extends [ E ](../../../org/hamcrest/collection/IsCollectionWithSize.html "type parameter in IsCollectionWithSize") > actual) `   
Implement this to extract the interesting feature.  
` static  |  ` <E> [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <java.util.Collection<? extends E>> `  
---  
` ` **[ hasSize
](../../../org/hamcrest/collection/IsCollectionWithSize.html#hasSize\(int\))
** (int size) `  
Creates a matcher for ` Collection ` s that matches when the ` size() ` method
returns a value equal to the specified ` size ` .  
` static  |  ` <E> [ Matcher ](../../../org/hamcrest/Matcher.html "interface in org.hamcrest") <java.util.Collection<? extends E>> `  
---  
` ` **[ hasSize
](../../../org/hamcrest/collection/IsCollectionWithSize.html#hasSize\(org.hamcrest.Matcher\))
** ( [ Matcher ](../../../org/hamcrest/Matcher.html "interface in
org.hamcrest") <? super java.lang.Integer> sizeMatcher) `  
Creates a matcher for ` Collection ` s that matches when the ` size() ` method
returns a value that satisfies the specified matcher.  
**Methods inherited from class org.hamcrest.[ FeatureMatcher
](../../../org/hamcrest/FeatureMatcher.html "class in org.hamcrest") **  
---  
` [ describeTo
](../../../org/hamcrest/FeatureMatcher.html#describeTo\(org.hamcrest.Description\))
, [ matchesSafely
](../../../