Class HasSize

  • All Implemented Interfaces:
    Quality<java.util.Collection<?>>

    public final class HasSize
    extends QualityComposition<java.util.Collection<?>>
    • Constructor Summary

      Constructors 
      Constructor Description
      HasSize​(int size)
      Creates a Quality that matches if size of the Collection under test is equal to the given value.
      HasSize​(Quality<? super java.lang.Integer> delegate)
      Creates a Quality that matches if the size Collection under test matches the given Quality.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HasSize

        public HasSize​(int size)
        Creates a Quality that matches if size of the Collection under test is equal to the given value.
             assertThat(asList(1,2,3), hasSize(3));
         
      • HasSize

        public HasSize​(Quality<? super java.lang.Integer> delegate)
        Creates a Quality that matches if the size Collection under test matches the given Quality.
             assertThat(asList(1,2,3), hasSize(lessThan(4)));