signature:
public class HuffmanEncoder { /** * Returns the number of bytes required to Huffman encode the input string literal .
 * @ param data the string literal to be Huffman encoded
 * @ return the number of bytes required to Huffman encode < code > data < / code > */
public int getEncodedLength ( byte [ ] data ) { } }

implementation: if ( data == null ) { throw new NullPointerException ( "data" ) ; } long len = 0 ; for ( byte b : data ) { len += lengths [ b & 0xFF ] ; } return ( int ) ( ( len + 7 ) >> 3 ) ;


signature:
public class Header { /** * Creates a number of random headers with the given name / value lengths . */
static List < Header > createHeaders ( int numHeaders , int nameLength , int valueLength , boolean limitToAscii ) { } }

implementation: List < Header > headers = new ArrayList < Header > ( numHeaders ) ; Random r = new Random ( ) ; for ( int i = 0 ; i < numHeaders ; ++ i ) { byte [ ] name = randomBytes ( new byte [ nameLength ] , limitToAscii ) ; byte [ ] value = randomBytes ( new byte [ valueLength ] , limitToAscii ) ; headers . add ( new Header ( name , value ) ) ; } return headers ;


signature:
public class DynamicTable { /** * Return the number of header fields in the dynamic table . */
public int length ( ) { } }

implementation: int length ; if ( head < tail ) { length = headerFields . length - tail + head ; } else { length = head - tail ; } return length ;


signature:
public class DynamicTable { /** * Return the header field at the given index .
 * The first and newest entry is always at index 1,
 * and the oldest entry is at the index length ( ) . */
public HeaderField getEntry ( int index ) { } }

implementation: if ( index <= 0 || index > length ( ) ) { throw new IndexOutOfBoundsException ( ) ; } int i = head - index ; if ( i < 0 ) { return headerFields [ i + headerFields . length ] ; } else { return headerFields [ i ] ; }


signature:
public class DynamicTable { /** * Add the header field to the dynamic table .
 * Entries are evicted from the dynamic table until the size of the table
 * and the new header field is less than or equal to the table ' s capacity .
 * If the size of the new entry is larger than the table ' s capacity ,
 * the dynamic table will be cleared . */
public void add ( HeaderField header ) { } }

implementation: int headerSize = header . size ( ) ; if ( headerSize > capacity ) { clear ( ) ; return ; } while ( size + headerSize > capacity ) { remove ( ) ; } headerFields [ head ++ ] = header ; size += header . size ( ) ; if ( head == headerFields . length ) { head = 0 ; }


signature:
public class DynamicTable { /** * Remove and return the oldest header field from the dynamic table . */
public HeaderField remove ( ) { } }

implementation: HeaderField removed = headerFields [ tail ] ; if ( removed == null ) { return null ; } size -= removed . size ( ) ; headerFields [ tail ++ ] = null ; if ( tail == headerFields . length ) { tail = 0 ; } return removed ;


signature:
public class DynamicTable { /** * Remove all entries from the dynamic table . */
public void clear ( ) { } }

implementation: while ( tail != head ) { headerFields [ tail ++ ] = null ; if ( tail == headerFields . length ) { tail = 0 ; } } head = 0 ; tail = 0 ; size = 0 ;


signature:
public class DynamicTable { /** * Set the maximum size of the dynamic table .
 * Entries are evicted from the dynamic table until the size of the table
 * is less than or equal to the maximum size . */
public void setCapacity ( int capacity ) { } }

implementation:
if ( capacity < 0 ) { throw new IllegalArgumentException ( "Illegal Capacity: " + capacity ) ; } // initially capacity will be - 1 so init won ' t return here
if ( this . capacity == capacity ) { return ; } this . capacity = capacity ; if ( capacity == 0 ) { clear ( ) ; } else { // initially size will be 0 so remove won ' t be called
while ( size > capacity ) { remove ( ) ; } } int maxEntries = capacity / HEADER_ENTRY_OVERHEAD ; if ( capacity % HEADER_ENTRY_OVERHEAD != 0 ) { maxEntries ++ ; } // check if capacity change requires us to reallocate the array
if ( headerFields != null && headerFields . length == maxEntries ) { return ; } HeaderField [ ] tmp = new HeaderField [ maxEntries ] ; // initially length will be 0 so there will be no copy
int len = length ( ) ; int cursor = tail ; for ( int i = 0 ; i < len ; i ++ ) { HeaderField entry = headerFields [ cursor ++ ] ; tmp [ i ] = entry ; if ( cursor == headerFields . length ) { cursor = 0 ; } } this . tail = 0 ; this . head = tail + len ; this . headerFields = tmp ;


signature:
public class Encoder { /** * Encode the header field into the header block . */
public void encodeHeader ( OutputStream out , byte [ ] name , byte [ ] value , boolean sensitive ) throws IOException { } }

implementation:
// If the header value is sensitive then it must never be indexed
if ( sensitive ) { int nameIndex = getNameIndex ( name ) ; encodeLiteral ( out , name , value , IndexType . NEVER , nameIndex ) ; return ; } // If the peer will only use the static table
if ( capacity == 0 ) { int staticTableIndex = StaticTable . getIndex ( name , value ) ; if ( staticTableIndex == - 1 ) { int nameIndex = StaticTable . getIndex ( name ) ; encodeLiteral ( out , name , value , IndexType . NONE , nameIndex ) ; } else { encodeInteger ( out , 0x80 , 7 , staticTableIndex ) ; } return ; } int headerSize = HeaderField . sizeOf ( name , value ) ; // If the headerSize is greater than the max table size then it must be encoded literally
if ( headerSize > capacity ) { int nameIndex = getNameIndex ( name ) ; encodeLiteral ( out , name , value , IndexType . NONE , nameIndex ) ; return ; } HeaderEntry headerField = getEntry ( name , value ) ; if ( headerField != null ) { int index = getIndex ( headerField . index ) + StaticTable . length ; // Section 6.1 . Indexed Header Field Representation
encodeInteger ( out , 0x80 , 7 , index ) ; } else { int staticTableIndex = StaticTable . getIndex ( name , value ) ; if ( staticTableIndex != - 1 ) { // Section 6.1 . Indexed Header Field Representation
encodeInteger ( out , 0x80 , 7 , staticTableIndex ) ; } else { int nameIndex = getNameIndex ( name ) ; if ( useIndexing ) { ensureCapacity ( headerSize ) ; } IndexType indexType = useIndexing ? IndexType . INCREMENTAL : IndexType . NONE ; encodeLiteral ( out , name , value , indexType , nameIndex ) ; if ( useIndexing ) { add ( name , value ) ; } } }


signature:
public class Encoder { /** * Set the maximum table size . */
public void setMaxHeaderTableSize ( OutputStream out , int maxHeaderTableSize ) throws IOException { } }

implementation: if ( maxHeaderTableSize < 0 ) { throw new IllegalArgumentException ( "Illegal Capacity: " + maxHeaderTableSize ) ; } if ( capacity == maxHeaderTableSize ) { return ; } capacity = maxHeaderTableSize ; ensureCapacity ( 0 ) ; encodeInteger ( out , 0x20 , 5 , maxHeaderTableSize ) ;


signature:
public class Encoder { /** * Encode integer according to Section 5.1. */
private static void encodeInteger ( OutputStream out , int mask , int n , int i ) throws IOException { } }

implementation: if ( n < 0 || n > 8 ) { throw new IllegalArgumentException ( "N: " + n ) ; } int nbits = 0xFF >>> ( 8 - n ) ; if ( i < nbits ) { out . write ( mask | i ) ; } else { out . write ( mask | nbits ) ; int length = i - nbits ; while ( true ) { if ( ( length & ~ 0x7F ) == 0 ) { out . write ( length ) ; return ; } else { out . write ( ( length & 0x7F ) | 0x80 ) ; length >>>= 7 ; } } }


signature:
public class Encoder { /** * Encode string literal according to Section 5.2. */
private void encodeStringLiteral ( OutputStream out , byte [ ] string ) throws IOException { } }

implementation: int huffmanLength = Huffman . ENCODER . getEncodedLength ( string ) ; if ( ( huffmanLength < string . length && ! forceHuffmanOff ) || forceHuffmanOn ) { encodeInteger ( out , 0x80 , 7 , huffmanLength ) ; Huffman . ENCODER . encode ( out , string ) ; } else { encodeInteger ( out , 0x00 , 7 , string . length ) ; out . write ( string , 0 , string . length ) ; }


signature:
public class Encoder { /** * Encode literal header field according to Section 6.2. */
private void encodeLiteral ( OutputStream out , byte [ ] name , byte [ ] value , IndexType indexType , int nameIndex ) throws IOException { } }

implementation: int mask ; int prefixBits ; switch ( indexType ) { case INCREMENTAL : mask = 0x40 ; prefixBits = 6 ; break ; case NONE : mask = 0x00 ; prefixBits = 4 ; break ; case NEVER : mask = 0x10 ; prefixBits = 4 ; break ; default : throw new IllegalStateException ( "should not reach here" ) ; } encodeInteger ( out , mask , prefixBits , nameIndex == - 1 ? 0 : nameIndex ) ; if ( nameIndex == - 1 ) { encodeStringLiteral ( out , name ) ; } encodeStringLiteral ( out , value ) ;


signature:
public class Encoder { /** * Ensure that the dynamic table has enough room to hold ' headerSize ' more bytes .
 * Removes the oldest entry from the dynamic table until sufficient space is available . */
private void ensureCapacity ( int headerSize ) throws IOException { } }

implementation: while ( size + headerSize > capacity ) { int index = length ( ) ; if ( index == 0 ) { break ; } remove ( ) ; }


signature:
public class Encoder { /** * Return the header field at the given index .
 * Exposed for testing . */
HeaderField getHeaderField ( int index ) { } }

implementation: HeaderEntry entry = head ; while ( index -- >= 0 ) { entry = entry . before ; } return entry ;


signature:
public class Encoder { /** * Returns the header entry with the lowest index value for the header field .
 * Returns null if header field is not in the dynamic table . */
private HeaderEntry getEntry ( byte [ ] name , byte [ ] value ) { } }

implementation: if ( length ( ) == 0 || name == null || value == null ) { return null ; } int h = hash ( name ) ; int i = index ( h ) ; for ( HeaderEntry e = headerFields [ i ] ; e != null ; e = e . next ) { if ( e . hash == h && HpackUtil . equals ( name , e . name ) && HpackUtil . equals ( value , e . value ) ) { return e ; } } return null ;


signature:
public class Encoder { /** * Returns the lowest index value for the header field name in the dynamic table .
 * Returns - 1 if the header field name is not in the dynamic table . */
private int getIndex ( byte [ ] name ) { } }

implementation: if ( length ( ) == 0 || name == null ) { return - 1 ; } int h = hash ( name ) ; int i = index ( h ) ; int index = - 1 ; for ( HeaderEntry e = headerFields [ i ] ; e != null ; e = e . next ) { if ( e . hash == h && HpackUtil . equals ( name , e . name ) ) { index = e . index ; break ; } } return getIndex ( index ) ;


signature:
public class Encoder { /** * Add the header field to the dynamic table .
 * Entries are evicted from the dynamic table until the size of the table
 * and the new header field is less than the table ' s capacity .
 * If the size of the new entry is larger than the table ' s capacity ,
 * the dynamic table will be cleared . */
private void add ( byte [ ] name , byte [ ] value ) { } }

implementation:
int headerSize = HeaderField . sizeOf ( name , value ) ; // Clear the table if the header field size is larger than the capacity .
if ( headerSize > capacity ) { clear ( ) ; return ; } // Evict oldest entries until we have enough capacity .
while ( size + headerSize > capacity ) { remove ( ) ; } // Copy name and value that modifications of original do not affect the dynamic table .
name = Arrays . copyOf ( name , name . length ) ; value = Arrays . copyOf ( value , value . length ) ; int h = hash ( name ) ; int i = index ( h ) ; HeaderEntry old = headerFields [ i ] ; HeaderEntry e = new HeaderEntry ( h , name , value , head . before . index - 1 , old ) ; headerFields [ i ] = e ; e . addBefore ( head ) ; size += headerSize ;


signature:
public class Encoder { /** * Remove and return the oldest header field from the dynamic table . */
private HeaderField remove ( ) { } }

implementation: if ( size == 0 ) { return null ; } HeaderEntry eldest = head . after ; int h = eldest . hash ; int i = index ( h ) ; HeaderEntry prev = headerFields [ i ] ; HeaderEntry e = prev ; while ( e != null ) { HeaderEntry next = e . next ; if ( e == eldest ) { if ( prev == eldest ) { headerFields [ i ] = next ; } else { prev . next = next ; } eldest . remove ( ) ; size -= eldest . size ( ) ; return eldest ; } prev = e ; e = next ; } return null ;


signature:
public class Encoder { /** * Remove all entries from the dynamic table . */
private void clear ( ) { } }

implementation: Arrays . fill ( headerFields , null ) ; head . before = head . after = head ; this . size = 0 ;


signature:
public class Encoder { /** * Returns the hash code for the given header field name . */
private static int hash ( byte [ ] name ) { } }

implementation: int h = 0 ; for ( int i = 0 ; i < name . length ; i ++ ) { h = 31 * h + name [ i ] ; } if ( h > 0 ) { return h ; } else if ( h == Integer . MIN_VALUE ) { return Integer . MAX_VALUE ; } else { return - h ; }


signature:
public class HuffmanDecoder { /** * Decompresses the given Huffman coded string literal .
 * @ param buf the string literal to be decoded
 * @ return the output stream for the compressed data
 * @ throws IOException if an I / O error occurs . In particular ,
 * an < code > IOException < / code > may be thrown if the
 * output stream has been closed . */
public byte [ ] decode ( byte [ ] buf ) throws IOException { } }

implementation:
ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; Node node = root ; int current = 0 ; int bits = 0 ; for ( int i = 0 ; i < buf . length ; i ++ ) { int b = buf [ i ] & 0xFF ; current = ( current << 8 ) | b ; bits += 8 ; while ( bits >= 8 ) { int c = ( current >>> ( bits - 8 ) ) & 0xFF ; node = node . children [ c ] ; bits -= node . bits ; if ( node . isTerminal ( ) ) { if ( node . symbol == HpackUtil . HUFFMAN_EOS ) { throw EOS_DECODED ; } baos . write ( node . symbol ) ; node = root ; } } } while ( bits > 0 ) { int c = ( current << ( 8 - bits ) ) & 0xFF ; node = node . children [ c ] ; if ( node . isTerminal ( ) && node . bits <= bits ) { bits -= node . bits ; baos . write ( node . symbol ) ; node = root ; } else { break ; } } // Section 5.2 . String Literal Representation
// Padding not corresponding to the most significant bits of the code
// for the EOS symbol ( 0xFF ) MUST be treated as a decoding error .
int mask = ( 1 << bits ) - 1 ; if ( ( current & mask ) != mask ) { throw INVALID_PADDING ; } return baos . toByteArray ( ) ;


signature:
public class AbstractMicrobenchmarkBase { /** * Gets headers for the given size and whether the key / values should be limited to ASCII . */
protected static List < Header > headers ( HeadersSize size , boolean limitToAscii ) { } }

implementation: return headersMap . get ( new HeadersKey ( size , limitToAscii ) ) ;


signature:
public class GroovyShellServiceBean { /** * Set the comma delimited list of default scripts
 * @ param scriptNames script names */
public void setDefaultScriptNames ( String scriptNames ) { } }

implementation: if ( ! scriptNames . trim ( ) . isEmpty ( ) ) service . setDefaultScripts ( asList ( scriptNames . split ( "," ) ) ) ;


signature:
public class Shorts { /** * Verifies that two shorts are equal .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertEqualTo ( Description description , Short actual , short expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isEqualTo ( actual , expected ) ) { throw failures . failure ( description , shouldBeEqual ( actual , expected ) ) ; }


signature:
public class Shorts { /** * Verifies that two integers are not equal .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertNotEqualTo ( Description description , Short actual , short expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( isEqualTo ( actual , expected ) ) { throw failures . failure ( description , shouldNotBeEqual ( actual , expected ) ) ; }


signature:
public class Shorts { /** * Verifies that the actual value is greater than the expected one .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertGreaterThan ( Description description , Short actual , short expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isGreaterThan ( actual , expected ) ) { throw failures . failure ( description , ShouldBeGreaterThan . shouldBeGreaterThan ( actual , expected ) ) ; }


signature:
public class AbstractAssert { /** * { @ inheritDoc } */
@ Override public S isEqualTo ( T expected ) { } }

implementation: objects . assertEqual ( description , actual , expected ) ; return myself ;


signature:
public class AbstractAssert { /** * { @ inheritDoc } */
@ Override public S isNotEqualTo ( T other ) { } }

implementation: objects . assertNotEqual ( description , actual , other ) ; return myself ;


signature:
public class Comparables { /** * Asserts that two values are equal by invoking { @ link Comparable # compareTo ( Object ) } .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is not equal to the expected one . This method will throw a
 * { @ code org . junit . ComparisonFailure } instead if JUnit is in the classpath and the expected and actual
 * values are not equal . */
public < T extends Comparable < T > > void assertEqual ( Description description , T actual , T expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! areEqual ( actual , expected ) ) { throw shouldBeEqual ( actual , expected ) . newAssertionError ( description ) ; }


signature:
public class Comparables { /** * Asserts that two values are not equal by invoking { @ link Comparable # compareTo ( Object ) } .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param other the value to compare the < em > actual < / em > value to .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is equal to the other one . */
public < T extends Comparable < T > > void assertNotEqual ( Description description , T actual , T other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( areEqual ( actual , other ) ) { throw failures . failure ( description , shouldNotBeEqual ( actual , other ) ) ; }


signature:
public class Comparables { /** * Asserts that the < em > actual < / em > value is less than the other one .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param other the value to compare the < em > actual < / em > value to .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is not less than the other one . */
public < T extends Comparable < T > > void assertLessThan ( Description description , T actual , T other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isLessThan ( actual , other ) ) { throw failures . failure ( description , shouldBeLessThan ( actual , other ) ) ; }


signature:
public class Comparables { /** * Asserts that the < em > actual < / em > value is greater than or equal to the other one .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param other the value to compare the actual value to .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is less than the other one . */
public < T extends Comparable < T > > void assertNotLessThan ( Description description , T actual , T other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( isLessThan ( actual , other ) ) { throw failures . failure ( description , shouldNotBeLessThan ( actual , other ) ) ; }


signature:
public class Comparables { /** * Asserts that the < em > actual < / em > value is greater than the other one .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param other the value to compare the < em > actual < / em > value to .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is not greater than the other one . */
public < T extends Comparable < T > > void assertGreaterThan ( Description description , T actual , T other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isGreaterThan ( actual , other ) ) { throw failures . failure ( description , shouldBeGreaterThan ( actual , other ) ) ; }


signature:
public class Comparables { /** * Asserts that the < em > actual < / em > value is less than or equal to the other one .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param other the value to compare the < em > actual < / em > value to .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is greater than the other one . */
public < T extends Comparable < T > > void assertNotGreaterThan ( Description description , T actual , T other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( isGreaterThan ( actual , other ) ) { throw failures . failure ( description , shouldNotBeGreaterThan ( actual , other ) ) ; }


signature:
public class Floats { /** * Verifies that the actual value is equal to { @ code NaN } .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsNaN ( Description description , Float actual ) { } }

implementation: comparables . assertEqual ( description , actual , Float . NaN ) ;


signature:
public class Floats { /** * Verifies that the actual value is not equal to { @ code NaN } .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsNotNaN ( Description description , Float actual ) { } }

implementation: comparables . assertNotEqual ( description , actual , Float . NaN ) ;


signature:
public class Floats { /** * Verifies that two floats are equal within a positive offset . < br >
 * It does not rely on the custom comparisionStrategy ( if one is set ) because using an offset is already a specific
 * comparison strategy .
 * @ param description describes the information about the assertion .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value .
 * @ param offset the given positive < em > offset < / em > .
 * @ throws NullPointerException if the given < em > offset < / em > is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is not equal to the < em > expected < / em > one . */
public void assertEqual ( Description description , Float actual , Float expected , Offset < Float > offset ) { } }

implementation: checkOffsetIsNotNull ( offset ) ; checkNumberIsNotNull ( expected ) ; assertNotNull ( description , actual ) ; if ( ! isEqualTo ( actual , expected , offset ) ) { throw failures . failure ( description , shouldBeEqual ( actual , expected , offset , abs ( expected . floatValue ( ) - actual . floatValue ( ) ) ) ) ; }


signature:
public class Floats { /** * Verifies that the actual value is great than the expected one .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertGreaterThan ( Description description , Float actual , float expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isGreaterThan ( actual , expected ) ) { throw failures . failure ( description , shouldBeGreaterThan ( actual , expected ) ) ; }


signature:
public class DescriptionFormatter { /** * Formats the given < code > { @ link Description } < / code > by surrounding its text value with square brackets and adding a space at
 * the end .
 * @ param d the description to format . It can be { @ code null } .
 * @ return the formatted description , or an empty { @ code String } if the the { @ code Description } is { @ code null } . */
public String format ( Description d ) { } }

implementation: String s = ( d != null ) ? d . value ( ) : null ; if ( isNullOrEmpty ( s ) ) return "" ; return String . format ( "[%s] " , s ) ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Nonnull @ Override public final S hasSize ( int expected ) { } }

implementation: collections . assertHasSize ( description , actual , expected ) ; return myself ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Override public final S contains ( Object ... values ) { } }

implementation: collections . assertContains ( description , actual , values ) ; return myself ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Override public final S containsOnly ( Object ... values ) { } }

implementation: collections . assertContainsOnly ( description , actual , values ) ; return myself ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Override public final S containsSequence ( Object ... sequence ) { } }

implementation: collections . assertContainsSequence ( description , actual , sequence ) ; return myself ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Override public final S doesNotContain ( Object ... values ) { } }

implementation: collections . assertDoesNotContain ( description , actual , values ) ; return myself ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Override public final S startsWith ( Object ... sequence ) { } }

implementation: collections . assertStartsWith ( description , actual , sequence ) ; return myself ;


signature:
public class AbstractCollectionAssert { /** * { @ inheritDoc } */
@ Override public final S endsWith ( Object ... sequence ) { } }

implementation: collections . assertEndsWith ( description , actual , sequence ) ; return myself ;


signature:
public class AbstractComparableAssert { /** * { @ inheritDoc } */
@ Override public S isEqualTo ( A expected ) { } }

implementation: comparables . assertEqual ( description , actual , expected ) ; return myself ;


signature:
public class AbstractComparableAssert { /** * { @ inheritDoc } */
@ Override public S isNotEqualTo ( A expected ) { } }

implementation: comparables . assertNotEqual ( description , actual , expected ) ; return myself ;


signature:
public class AbstractComparableAssert { /** * { @ inheritDoc } */
@ Override public S isLessThan ( A other ) { } }

implementation: comparables . assertLessThan ( description , actual , other ) ; return myself ;


signature:
public class AbstractComparableAssert { /** * { @ inheritDoc } */
@ Override public S isNotLessThan ( A other ) { } }

implementation: comparables . assertNotLessThan ( description , actual , other ) ; return myself ;


signature:
public class AbstractComparableAssert { /** * { @ inheritDoc } */
@ Override public S isGreaterThan ( A other ) { } }

implementation: comparables . assertGreaterThan ( description , actual , other ) ; return myself ;


signature:
public class AbstractComparableAssert { /** * { @ inheritDoc } */
@ Override public S isNotGreaterThan ( A other ) { } }

implementation: comparables . assertNotGreaterThan ( description , actual , other ) ; return myself ;


signature:
public class Strings { /** * Asserts that the < em > actual < / em > { @ code String } is { @ code null } or empty .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is not { @ code null } and not empty . */
public void assertNullOrEmpty ( @ Nullable Description description , @ Nullable String actual ) { } }

implementation: if ( ! isNullOrEmpty ( actual ) ) { throw failures . failure ( description , shouldBeNullOrEmpty ( actual ) ) ; }


signature:
public class Strings { /** * Asserts that the < em > actual < / em > { @ code String } is empty .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is not empty . */
public void assertEmpty ( @ Nullable Description description , @ Nullable String actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! actual . isEmpty ( ) ) { throw failures . failure ( description , shouldBeEmpty ( actual ) ) ; }


signature:
public class Strings { /** * Asserts that the < em > actual < / em > { @ code String } is not empty .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is empty . */
public void assertNotEmpty ( @ Nullable Description description , @ Nullable String actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . isEmpty ( ) ) { throw failures . failure ( description , shouldNotBeEmpty ( ) ) ; }


signature:
public class Strings { /** * Asserts that the size of the < em > actual < / em > { @ code String } is equal to the expected one .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param expectedSize the expected size of { @ code actual } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the size of the < em > actual < / em > { @ code String } is different than the expected one . */
public void assertHasSize ( @ Nullable Description description , @ Nullable String actual , int expectedSize ) { } }

implementation: assertNotNull ( description , actual ) ; int actualSize = actual . length ( ) ; if ( actualSize != expectedSize ) { throw failures . failure ( description , shouldHaveSize ( actual , actualSize , expectedSize ) ) ; }


signature:
public class Strings { /** * Verifies that two { @ code String } s are equal , ignoring case considerations .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param expected the expected { @ code String } .
 * @ throws AssertionError if the given { @ code String } s are not equal . */
public void assertEqualsIgnoringCase ( @ Nullable Description description , @ Nullable String actual , @ Nullable String expected ) { } }

implementation: if ( ! areEqualIgnoringCase ( actual , expected ) ) { String format = "expecting:<%s> to be equal to:<%s>, ignoring case considerations" ; throw failures . failure ( description , new BasicErrorMessageFactory ( format , actual , expected ) ) ; }


signature:
public class Strings { /** * Verifies that the < em > actual < / em > { @ code String } contains the given sequence .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param sequence the sequence to look for .
 * @ throws NullPointerException if the given sequence is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } does not contain the given sequence . */
public void assertContains ( @ Nullable Description description , @ Nullable String actual , @ Nonnull String sequence ) { } }

implementation: checkNotNull ( sequence ) ; assertNotNull ( description , actual ) ; if ( ! actual . contains ( sequence ) ) { String format = "expecting:<%s> to contain:<%s>" ; throw failures . failure ( description , new BasicErrorMessageFactory ( format , actual , sequence ) ) ; }


signature:
public class Strings { /** * Verifies that the < em > actual < / em > { @ code String } starts with the given prefix .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param prefix the given prefix .
 * @ throws NullPointerException if the given sequence is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } does not start with the given prefix . */
public void assertStartsWith ( @ Nullable Description description , @ Nullable String actual , @ Nonnull String prefix ) { } }

implementation: checkNotNull ( prefix ) ; assertNotNull ( description , actual ) ; if ( ! actual . startsWith ( prefix ) ) { throw failures . failure ( description , shouldStartWith ( actual , prefix ) ) ; }


signature:
public class Strings { /** * Verifies that the < em > actual < / em > { @ code String } ends with the given suffix .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param suffix the given suffix .
 * @ throws NullPointerException if the given sequence is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } does not end with the given suffix . */
public void assertEndsWith ( @ Nullable Description description , @ Nullable String actual , @ Nonnull String suffix ) { } }

implementation: checkNotNull ( suffix ) ; assertNotNull ( description , actual ) ; if ( ! actual . endsWith ( suffix ) ) { throw failures . failure ( description , shouldEndWith ( actual , suffix ) ) ; }


signature:
public class Strings { /** * Verifies that the < em > actual < / em > { @ code String } matches the given regular expression .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param regex the regular expression to which the < em > actual < / em > { @ code String } is to be matched .
 * @ throws NullPointerException if the given regular expression is { @ code null } .
 * @ throws PatternSyntaxException if the regular expression ' s syntax is invalid .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } does not match the given regular expression . */
public void assertMatches ( @ Nullable Description description , @ Nullable String actual , @ Nonnull String regex ) { } }

implementation: checkNotNull ( regex ) ; assertMatches ( description , actual , Pattern . compile ( regex ) ) ;


signature:
public class Strings { /** * Verifies that the < em > actual < / em > { @ code String } matches the given regular expression .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param pattern the compiled representation of the regular expression pattern to which the < em > actual < / em >
 * { @ code String } is to be matched .
 * @ throws NullPointerException if the given pattern is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } does not match the given regular expression . */
public void assertMatches ( @ Nullable Description description , @ Nullable String actual , @ Nonnull Pattern pattern ) { } }

implementation: checkNotNull ( pattern ) ; assertNotNull ( description , actual ) ; if ( ! pattern . matcher ( actual ) . matches ( ) ) { String format = "expecting:<%s> to match regular expression:<%s>" ; throw failures . failure ( description , new BasicErrorMessageFactory ( format , actual , pattern . pattern ( ) ) ) ; }


signature:
public class Strings { /** * Verifies that the < em > actual < / em > { @ code String } does not match the given regular expression .
 * @ param description the description of the < em > actual < / em > { @ code String } .
 * @ param actual the < em > actual < / em > { @ code String } .
 * @ param pattern the compiled representation of the regular expression pattern to which the < em > actual < / em >
 * { @ code String } is to be matched .
 * @ throws NullPointerException if the given pattern is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code String } matches the given regular expression . */
public void assertDoesNotMatch ( @ Nullable Description description , @ Nullable String actual , @ Nonnull Pattern pattern ) { } }

implementation: checkNotNull ( pattern ) ; if ( actual != null && pattern . matcher ( actual ) . matches ( ) ) { String format = "expecting:<%s> not to match regular expression:<%s>" ; throw failures . failure ( description , new BasicErrorMessageFactory ( format , actual , pattern . pattern ( ) ) ) ; }


signature:
public class Matchers { /** * Asserts that the < em > actual < / em > value satisfies the given { @ link Matcher } .
 * @ param < T > the type of the actual value and the type of values that given { @ code Matcher } takes .
 * @ param description the description of the < em > actual < / em > object .
 * @ param actual the < em > actual < / em > value .
 * @ param matcher the given { @ code Matcher } .
 * @ throws NullPointerException if the given { @ code Matcher } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value does not satisfy the given { @ code Matcher } . */
public < T > void assertIs ( Description description , T actual , Matcher < ? super T > matcher ) { } }

implementation: checkNotNull ( matcher ) ; if ( ! matcher . matches ( actual ) ) { String format = "expecting:<%s> to be:<%s>" ; throw failures . failure ( description , new BasicErrorMessageFactory ( format , actual , matcher ) ) ; }


signature:
public class Characters { /** * Asserts that two characters are equal .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ param expected the expected value .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is not equal to the expected one . This method will throw a
 * { @ code org . junit . ComparisonFailure } instead if JUnit is in the classpath and the expected and actual
 * values are not equal . */
public void assertEqual ( Description description , Character actual , char expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . charValue ( ) != expected ) { throw failures . failure ( description , shouldBeEqual ( actual , expected ) ) ; }


signature:
public class Characters { /** * Asserts that two characters are not equal .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ param other the value to compare the actual value to .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is equal to the other one . */
public void assertNotEqual ( Description description , Character actual , char other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . charValue ( ) == other ) { throw failures . failure ( description , shouldNotBeEqual ( actual , other ) ) ; }


signature:
public class Characters { /** * Asserts that the actual value is less than the other one .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ param other the value to compare the actual value to .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is not less than the other one : this assertion will fail if the actual
 * value is equal to or greater than the other value . */
public void assertLessThan ( Description description , Character actual , char other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isLessThan ( actual , other ) ) { throw failures . failure ( description , shouldBeLessThan ( actual , other ) ) ; }


signature:
public class Characters { /** * Asserts that the actual value is less than or equal to the other one .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ param other the value to compare the actual value to .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is greater than the other one . */
public void assertNotGreaterThan ( Description description , Character actual , char other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( isGreaterThan ( actual , other ) ) { throw failures . failure ( description , shouldNotBeGreaterThan ( actual , other ) ) ; }


signature:
public class Characters { /** * Asserts that the actual value is greater than the other one .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ param other the value to compare the actual value to .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is not greater than the other one : this assertion will fail if the
 * actual value is equal to or less than the other value . */
public void assertGreaterThan ( Description description , Character actual , char other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isGreaterThan ( actual , other ) ) { throw failures . failure ( description , shouldBeGreaterThan ( actual , other ) ) ; }


signature:
public class Characters { /** * Asserts that the actual value is greater than or equal to the other one .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ param other the value to compare the actual value to .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is less than the other one . */
public void assertNotLessThan ( Description description , Character actual , char other ) { } }

implementation: assertNotNull ( description , actual ) ; if ( isLessThan ( actual , other ) ) { throw failures . failure ( description , ShouldNotBeLessThan . shouldNotBeLessThan ( actual , other ) ) ; }


signature:
public class Characters { /** * Asserts that the actual value is a lowercase character .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is not a lowercase character . */
public void assertLowerCase ( Description description , Character actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isLowerCase ( actual ) ) { throw failures . failure ( description , shouldBeLowerCase ( actual ) ) ; }


signature:
public class Characters { /** * Asserts that the actual value is a uppercase character .
 * @ param description contains information about the assertion .
 * @ param actual the actual value .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is not a uppercase character . */
public void assertUpperCase ( Description description , Character actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isUpperCase ( actual ) ) { throw failures . failure ( description , shouldBeUpperCase ( actual ) ) ; }


signature:
public class Lists { /** * Asserts that the given { @ code List } is not empty .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } is not empty . */
public void assertNotEmpty ( Description description , List < ? > actual ) { } }

implementation: assertNotNull ( description , actual ) ; checkNotEmpty ( description , actual ) ;


signature:
public class Lists { /** * Asserts that the number of elements in the given { @ code List } is equal to the expected one .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param expectedSize the expected size of { @ code actual } .
 * @ throws AssertionError if the given { @ code Collection } is { @ code null } .
 * @ throws AssertionError if the number of elements in the given { @ code List } is different than the expected one . */
public void assertHasSize ( Description description , List < ? > actual , int expectedSize ) { } }

implementation: assertNotNull ( description , actual ) ; int sizeOfActual = actual . size ( ) ; if ( sizeOfActual != expectedSize ) { throw failures . failure ( description , shouldHaveSize ( actual , sizeOfActual , expectedSize ) ) ; }


signature:
public class Lists { /** * Asserts that the given { @ code List } contains the given object at the given index .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param value the object to look for .
 * @ param index the index where the object should be stored in the given { @ code List } .
 * @ throws AssertionError if the given { @ code List } is { @ code null } or empty .
 * @ throws NullPointerException if the given { @ code Index } is { @ code null } .
 * @ throws IndexOutOfBoundsException if the value of the given { @ code Index } is equal to or greater than the size of
 * the given { @ code List } .
 * @ throws AssertionError if the given { @ code List } does not contain the given object at the given index . */
public void assertContains ( Description description , List < ? > actual , Object value , Index index ) { } }

implementation: assertNotNull ( description , actual ) ; checkNotEmpty ( description , actual ) ; checkIndexValueIsValid ( index , actual . size ( ) - 1 ) ; Object actualElement = actual . get ( index . value ) ; if ( ! areEqual ( actualElement , value ) ) { throw failures . failure ( description , shouldContainAtIndex ( actual , value , index , actual . get ( index . value ) ) ) ; }


signature:
public class Lists { /** * Asserts that the given { @ code List } contains { @ code null } .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Collection } .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } does not contain null . */
public void assertContainsNull ( Description description , List < ? > actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! actual . contains ( null ) ) { throw failures . failure ( description , shouldContainNull ( actual ) ) ; }


signature:
public class Lists { /** * Asserts that the given { @ code List } contains only the given values and nothing else , in any order . Duplicates are
 * allowed .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param values the values that are expected to be in the given { @ code List } .
 * @ throws NullPointerException if the array of values is { @ code null } .
 * @ throws IllegalArgumentException if the array of values is empty .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } does not contain the given values or if the given { @ code List }
 * contains values that are not in the given array . */
public void assertContainsOnly ( Description description , List < ? > actual , Object [ ] values ) { } }

implementation: checkIsNotNullAndNotEmpty ( values ) ; assertNotNull ( description , actual ) ; Set < Object > notExpected = new LinkedHashSet < Object > ( actual ) ; Set < Object > notFound = containsOnly ( notExpected , values ) ; if ( notExpected . isEmpty ( ) && notFound . isEmpty ( ) ) { return ; } throw failures . failure ( description , shouldContainOnly ( actual , values , notFound , notExpected ) ) ;


signature:
public class Lists { /** * Asserts that the given { @ code List } contains all of the given values , in any order . Duplicates are allowed .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param values the values that are expected to be in the given { @ code List } .
 * @ throws NullPointerException if the array of values is { @ code null } .
 * @ throws IllegalArgumentException if the array of values is empty .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } does not contain all the given values . */
public void assertContains ( Description description , List < ? > actual , Object [ ] values ) { } }

implementation: checkIsNotNullAndNotEmpty ( values ) ; assertNotNull ( description , actual ) ; Set < Object > copyOfActual = new LinkedHashSet < Object > ( actual ) ; Set < Object > notFound = containsOnly ( copyOfActual , values ) ; if ( ! notFound . isEmpty ( ) ) { throw failures . failure ( description , shouldContain ( actual , values , notFound ) ) ; }


signature:
public class Lists { /** * Verifies that the given { @ code List } does not contain the given object at the given index .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param value the object to look for .
 * @ param index the index where the object should be stored in the given { @ code List } .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws NullPointerException if the given { @ code Index } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } contains the given object at the given index . */
public void assertDoesNotContain ( Description description , List < ? > actual , Object value , Index index ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . isEmpty ( ) || index . value >= actual . size ( ) ) { return ; } Object actualElement = actual . get ( index . value ) ; if ( areEqual ( actualElement , value ) ) { throw failures . failure ( description , shouldNotContainAtIndex ( actual , value , index ) ) ; }


signature:
public class Lists { /** * Asserts that the given { @ code List } does not contain { @ code null } .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } contains any of given values . */
public void assertDoesNotContainNull ( Description description , List < ? > actual ) { } }

implementation: assertNotNull ( description , actual ) ; assertNotEmpty ( description , actual ) ; if ( actual . contains ( null ) ) { throw failures . failure ( description , shouldNotContainNull ( actual ) ) ; }


signature:
public class Lists { /** * Asserts that the given { @ code List } starts with the given sequence of objects , without any other objects between
 * them . Similar to < code > { @ link # assertContainsSequence ( Description , List , Object [ ] ) } < / code > , but it also verifies
 * that the first element in the sequence is also the first element of the given { @ code List } .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param sequence the sequence of objects to look for .
 * @ throws NullPointerException if the given argument is { @ code null } .
 * @ throws IllegalArgumentException if the given argument is an empty array .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } does not start with the given sequence of objects . */
public void assertStartsWith ( Description description , List < ? > actual , Object [ ] sequence ) { } }

implementation: checkIsNotNullAndNotEmpty ( sequence ) ; assertNotNull ( description , actual ) ; int sequenceSize = sequence . length ; if ( actual . size ( ) < sequenceSize ) { throw actualDoesNotStartWithSequence ( description , actual , sequence ) ; } int i = 0 ; for ( Object o : actual ) { if ( i >= sequenceSize ) { break ; } if ( areEqual ( o , sequence [ i ++ ] ) ) { continue ; } throw actualDoesNotStartWithSequence ( description , actual , sequence ) ; }


signature:
public class Lists { /** * Verifies that the given { @ code List } ends with the given sequence of objects , without any other objects between
 * them . Similar to < code > { @ link # assertContainsSequence ( Description , List , Object [ ] ) } < / code > , but it also verifies
 * that the last element in the sequence is also the last element of the given { @ code List } .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ param sequence the sequence of objects to look for .
 * @ throws NullPointerException if the given argument is { @ code null } .
 * @ throws IllegalArgumentException if the given argument is an empty array .
 * @ throws AssertionError if the given { @ code List } is { @ code null } .
 * @ throws AssertionError if the given { @ code List } does not end with the given sequence of objects . */
public void assertEndsWith ( Description description , List < ? > actual , Object [ ] sequence ) { } }

implementation: checkIsNotNullAndNotEmpty ( sequence ) ; assertNotNull ( description , actual ) ; int sequenceSize = sequence . length ; int sizeOfActual = actual . size ( ) ; if ( sizeOfActual < sequenceSize ) { throw actualDoesNotEndWithSequence ( description , actual , sequence ) ; } int start = actual . size ( ) - sequenceSize ; int sequenceIndex = 0 , indexOfActual = 0 ; for ( Object o : actual ) { if ( indexOfActual ++ < start ) { continue ; } if ( areEqual ( o , sequence [ sequenceIndex ++ ] ) ) { continue ; } throw actualDoesNotEndWithSequence ( description , actual , sequence ) ; }


signature:
public class ShouldNotContain { /** * Creates a new < / code > { @ link ShouldNotContain } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param expected values expected not to be contained in { @ code actual } .
 * @ param found the values in { @ code expected } found in { @ code actual } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldNotContain ( Object actual , Object expected , Object found ) { } }

implementation: return new ShouldNotContain ( actual , expected , found ) ;


signature:
public class ShouldNotBeBetween { /** * Creates a new < / code > { @ link ShouldNotBeBetween } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param start the lower boundary of date period .
 * @ param end the lower boundary of date period .
 * @ param inclusiveStart wether to include start date in period .
 * @ param inclusiveEnd wether to include end date in period .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldNotBeBetween ( Date actual , Date start , Date end , boolean inclusiveStart , boolean inclusiveEnd ) { } }

implementation: return new ShouldNotBeBetween ( actual , start , end , inclusiveStart , inclusiveEnd ) ;


signature:
public class AbstractUnevenComparableAssert { /** * { @ inheritDoc } */
@ Override public S isNotEqualByComparingTo ( A other ) { } }

implementation: comparables . assertNotEqual ( description , actual , other ) ; return myself ;


signature:
public class ElementsShouldHaveExactly { /** * Creates a new < / code > { @ link ElementsShouldHaveExactly } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param times exactly times the condition should be verify .
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory elementsShouldHaveExactly ( Object actual , int times , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldHaveExactly ( actual , times , condition ) ;


signature:
public class ShouldContainAtIndex { /** * Creates a new < / code > { @ link ShouldContainAtIndex } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param expected value expected to be in { @ code actual } .
 * @ param index the index of the expected value .
 * @ param found the value in { @ code actual } stored under { @ code index } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldContainAtIndex ( Object actual , Object expected , Index index , Object found ) { } }

implementation: return new ShouldContainAtIndex ( actual , expected , index , found ) ;


signature:
public class ElementsShouldNotHaveExactly { /** * Creates a new < / code > { @ link ElementsShouldNotHaveExactly } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param times exactly times the condition should be verify .
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory elementsShouldNotHaveExactly ( Object actual , int times , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotHaveExactly ( actual , times , condition ) ;


signature:
public class ShouldHaveSize { /** * Creates a new { @ link ShouldHaveSize } .
 * @ param actual the < em > actual < / em > value in the failed assertion .
 * @ param actualSize the size of { @ code actual } .
 * @ param expectedSize the expected size .
 * @ return the created { @ code ShouldHaveSize } . */
public static ErrorMessageFactory shouldHaveSize ( Object actual , Object actualSize , Object expectedSize ) { } }

implementation: return new ShouldHaveSize ( actual , actualSize , expectedSize ) ;


signature:
public class FileAssert { /** * Verifies that the content of the file represented by the < em > actual < / em > { @ code File } is equal to the content of
 * the file represented by the given { @ code File } . It is assumed that the content of the files is text .
 * @ param expected the < em > expected < / em > { @ code File } .
 * @ param charset the charset to use when reading the contents of the { @ code File } s .
 * @ return { @ code this } assertion object .
 * @ throws NullPointerException if the < em > expected < / em > { @ code File } is { @ code null } .
 * @ throws IllegalArgumentException if the < em > expected < / em > { @ code File } does not represent an existing file .
 * @ throws NullPointerException if the given charset is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code File } is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > { @ code File } does not represent an existing file .
 * @ throws IORuntimeException if an I / O error occurs .
 * @ throws AssertionError if the content of the file represented by the < em > actual < / em > { @ code File } is not equal to
 * the content of the file represented by the given { @ code File } . */
public FileAssert hasContentEqualTo ( File expected , Charset charset ) { } }

implementation: files . assertEqualContent ( description , actual , expected , charset ) ; return this ;


signature:
public class Sets { /** * Asserts that the given < code > { @ link Set } < / code > is { @ code null } or empty .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Set } .
 * @ throws AssertionError if the given { @ code Set } is not { @ code null } * and * contains one or more elements . */
public void assertNullOrEmpty ( Description description , Set < ? > actual ) { } }

implementation: if ( actual == null || actual . isEmpty ( ) ) { return ; } throw failures . failure ( description , shouldBeNullOrEmpty ( actual ) ) ;


signature:
public class Sets { /** * Asserts that the given { @ code Set } is not empty .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code List } .
 * @ throws AssertionError if the given { @ code Set } is { @ code null } .
 * @ throws AssertionError if the given { @ code Set } is not empty . */
public void assertNotEmpty ( Description description , Set < ? > actual ) { } }

implementation: assertNotNull ( description , actual ) ; checkNotEmpty ( description , actual ) ;


signature:
public class Sets { /** * Asserts that the given { @ code Set } contains the given object .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Set } .
 * @ param values the object to look for .
 * @ throws AssertionError if the given { @ code Set } is { @ code null } or empty .
 * @ throws AssertionError if the given { @ code Set } does not contain the given object . */
public void assertContains ( Description description , Set < ? > actual , Object [ ] values ) { } }

implementation: assertNotNull ( description , actual ) ; checkNotEmpty ( description , actual ) ; checkIsNotNullAndNotEmpty ( values ) ; Set < Object > notFound = new LinkedHashSet < Object > ( ) ; for ( Object value : values ) { if ( ! actual . contains ( value ) ) { notFound . add ( value ) ; } } if ( ! notFound . isEmpty ( ) ) { throw failures . failure ( description , ShouldContain . shouldContain ( actual , values , notFound ) ) ; }


signature:
public class Sets { /** * Asserts that the number of values in the given { @ code Set } is equal to the expected one .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Set } .
 * @ param expectedSize the expected size of { @ code actual } .
 * @ throws AssertionError if the given { @ code Set } is { @ code null } .
 * @ throws AssertionError if the number of values in the given { @ code Set } is different than the expected one . */
public void assertHasSize ( Description description , Set < ? > actual , int expectedSize ) { } }

implementation: assertNotNull ( description , actual ) ; if ( expectedSize < 0 ) { throw failures . failure ( description , shouldNotBeLessThan ( expectedSize , 0 ) ) ; } int sizeOfActual = actual . size ( ) ; if ( sizeOfActual != expectedSize ) { throw failures . failure ( description , shouldHaveSize ( actual , sizeOfActual , expectedSize ) ) ; }


signature:
public class ShouldNotContainAtIndex { /** * Creates a new < / code > { @ link ShouldNotContainAtIndex } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param expected value expected to be in { @ code actual } .
 * @ param index the index of the expected value .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldNotContainAtIndex ( Object actual , Object expected , Index index ) { } }

implementation: return new ShouldNotContainAtIndex ( actual , expected , index ) ;


signature:
public class AnyOf { /** * Creates a new < code > { @ link AnyOf } < / code >
 * @ param < T > the type of object the given condition accept .
 * @ param conditions the conditions to evaluate .
 * @ return the created { @ code AnyOf } .
 * @ throws NullPointerException if the given iterable is { @ code null } .
 * @ throws NullPointerException if any of the elements in the given iterable is { @ code null } . */
public static < T > Matcher < T > anyOf ( Iterable < ? extends Matcher < ? super T > > conditions ) { } }

implementation: return new AnyOf < T > ( conditions ) ;


signature:
public class AnyOf { /** * { @ inheritDoc } */
@ Override public boolean matches ( T value ) { } }

implementation: for ( Matcher < ? super T > condition : conditions ) if ( condition . matches ( value ) ) return true ; return false ;


signature:
public class ShouldHaveSameSizeAs { /** * Creates a new < / code > { @ link ShouldHaveSameSizeAs } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param actualSize the size of { @ code actual } .
 * @ param expectedSize the expected size .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldHaveSameSizeAs ( Object actual , Object actualSize , Object expectedSize ) { } }

implementation: return new ShouldHaveSameSizeAs ( actual , actualSize , expectedSize ) ;


signature:
public class ShouldBeWithin { /** * Creates a new < / code > { @ link ShouldBeWithin } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param fieldDescription the fieldDescription of value : year , month , day , . . .
 * @ param fieldValue the field value used in the failed assertion to compare the actual date field value to .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldBeWithin ( Date actual , String fieldDescription , int fieldValue ) { } }

implementation: return new ShouldBeWithin ( actual , fieldDescription , fieldValue ) ;


signature:
public class MessageFormatter { /** * Interprets a printf - style format { @ code String } for failed assertion messages . It is similar to
 * < code > { @ link String # format ( String , Object . . . ) } < / code > , except for :
 * < ol >
 * < li > the value of the given < code > { @ link Description } < / code > is used as the first argument referenced in the format
 * string < / li >
 * < li > each of the arguments in the given array is converted to a { @ code String } by invoking
 * < code > { @ link ToString # toStringOf ( Object ) } < / code > .
 * < / ol >
 * @ param d the description of the failed assertion , may be { @ code null } .
 * @ param format the format string .
 * @ param args arguments referenced by the format specifiers in the format string .
 * @ throws NullPointerException if the format string is { @ code null } .
 * @ return A formatted { @ code String } . */
public String format ( Description d , String format , Object ... args ) { } }

implementation: checkNotNull ( format ) ; checkNotNull ( args ) ; return descriptionFormatter . format ( d ) + String . format ( format , format ( args ) ) ;


signature:
public class DoubleArrayAssert { /** * { @ inheritDoc } */
@ Nonnull @ Override public DoubleArrayAssert hasSize ( int expected ) { } }

implementation: arrays . assertHasSize ( description , actual , expected ) ; return this ;


signature:
public class DoubleArrayAssert { /** * Verifies that the given array does not contain the given value at the given index .
 * @ param value the value to look for .
 * @ param index the index where the value should be stored in the given array .
 * @ return { @ code this } assertion object .
 * @ throws AssertionError if the given array is { @ code null } .
 * @ throws NullPointerException if the given { @ code Index } is { @ code null } .
 * @ throws AssertionError if the given array contains the given value at the given index . */
public DoubleArrayAssert doesNotContain ( double value , Index index ) { } }

implementation: arrays . assertDoesNotContain ( description , actual , value , index ) ; return this ;


signature:
public class ElementsShouldNotBeExactly { /** * Creates a new < / code > { @ link ElementsShouldNotBeExactly } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param times exactly times the condition should be verify .
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory elementsShouldNotBeExactly ( Object actual , int times , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotBeExactly ( actual , times , condition ) ;


signature:
public class ShouldBeAtIndex { /** * Creates a new < / code > { @ link ShouldBeAtIndex } < / code > .
 * @ param < T > guarantees that the type of the actual value and the generic type of the { @ code Condition } are the same .
 * @ param actual the actual value in the failed assertion .
 * @ param condition the { @ code Condition } .
 * @ param index the index of the expected value .
 * @ param found the value in { @ code actual } stored under { @ code index } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < T > ErrorMessageFactory shouldBeAtIndex ( List < T > actual , Matcher < ? super T > condition , Index index , T found ) { } }

implementation: return new ShouldBeAtIndex ( actual , condition , index , found ) ;


signature:
public class IntArrays { /** * Asserts that the number of elements in the given array is equal to the expected one .
 * @ param description contains information about the assertion .
 * @ param actual the given array .
 * @ param expectedSize the expected size of { @ code actual } .
 * @ throws AssertionError if the given array is { @ code null } .
 * @ throws AssertionError if the number of elements in the given array is different than the expected one . */
public void assertHasSize ( Description description , int [ ] actual , int expectedSize ) { } }

implementation: arrays . assertHasSize ( description , actual , expectedSize ) ;


signature:
public class IntArrays { /** * Asserts that the given array contains the given values , in any order .
 * @ param description contains information about the assertion .
 * @ param actual the given array .
 * @ param values the values that are expected to be in the given array .
 * @ throws NullPointerException if the array of values is { @ code null } .
 * @ throws IllegalArgumentException if the array of values is empty .
 * @ throws AssertionError if the given array is { @ code null } .
 * @ throws AssertionError if the given array does not contain the given values . */
public void assertContains ( Description description , int [ ] actual , int [ ] values ) { } }

implementation: arrays . assertContains ( description , actual , values ) ;


signature:
public class ElementsShouldNotBeAtMost { /** * Creates a new < / code > { @ link ElementsShouldNotBeAtMost } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param times least time the condition should be verify .
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory elementsShouldNotBeAtMost ( Object actual , int times , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotBeAtMost ( actual , times , condition ) ;


signature:
public class Maps { /** * Asserts that the given { @ code Map } is empty .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ throws AssertionError if the given { @ code Map } is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } is not empty . */
public void assertEmpty ( Description description , Map < ? , ? > actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! actual . isEmpty ( ) ) { throw failures . failure ( description , shouldBeEmpty ( actual ) ) ; }


signature:
public class Maps { /** * Asserts that the given { @ code Map } is not empty .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ throws AssertionError if the given { @ code Map } is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } is empty . */
public void assertNotEmpty ( Description description , Map < ? , ? > actual ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . isEmpty ( ) ) { throw failures . failure ( description , shouldNotBeEmpty ( ) ) ; }


signature:
public class Maps { /** * Asserts that the given { @ code Map } contains the given entries , in any order .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param entries the entries that are expected to be in the given { @ code Map } .
 * @ throws NullPointerException if the array of entries is { @ code null } .
 * @ throws IllegalArgumentException if the array of entries is empty .
 * @ throws NullPointerException if any of the entries in the given array is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } does not contain the given entries . */
public void assertContains ( Description description , Map < ? , ? > actual , MapEntry [ ] entries ) { } }

implementation: isNotEmptyOrNull ( entries ) ; assertNotNull ( description , actual ) ; Set < MapEntry > notFound = new LinkedHashSet < MapEntry > ( ) ; for ( MapEntry entry : entries ) { if ( ! containsEntry ( actual , entry ) ) { notFound . add ( entry ) ; } } if ( ! notFound . isEmpty ( ) ) { throw failures . failure ( description , shouldContain ( actual , entries , notFound ) ) ; }


signature:
public class Maps { /** * Asserts that the given { @ code Map } contains only the given entries , nothing else .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param entries the entries that are expected to be in the given { @ code Map } .
 * @ throws NullPointerException if the array of entries is { @ code null } .
 * @ throws IllegalArgumentException if the array of entries is empty .
 * @ throws NullPointerException if any of the entries in the given array is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } does not contain the given entries . */
public < K , V > void assertContainsOnly ( Description description , Map < K , V > actual , MapEntry [ ] entries ) { } }

implementation: isNotEmptyOrNull ( entries ) ; assertNotNull ( description , actual ) ; Map < K , V > notExpected = new LinkedHashMap < K , V > ( actual ) ; Set < MapEntry > notFound = containsOnly ( actual , entries , notExpected ) ; if ( ! notFound . isEmpty ( ) || ! notExpected . isEmpty ( ) ) { throw failures . failure ( description , shouldContainOnly ( actual , entries , notFound , notExpected ) ) ; }


signature:
public class Maps { /** * Asserts that the given { @ code Map } does not contain the given entries .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param entries the entries that are expected to be in the given { @ code Map } .
 * @ throws NullPointerException if the array of entries is { @ code null } .
 * @ throws IllegalArgumentException if the array of entries is empty .
 * @ throws NullPointerException if any of the entries in the given array is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } is { @ code null } .
 * @ throws AssertionError if the given { @ code Map } contains any of the given entries . */
public void assertDoesNotContain ( Description description , Map < ? , ? > actual , MapEntry [ ] entries ) { } }

implementation: isNotEmptyOrNull ( entries ) ; assertNotNull ( description , actual ) ; Set < MapEntry > found = new LinkedHashSet < MapEntry > ( ) ; for ( MapEntry entry : entries ) { if ( containsEntry ( actual , entry ) ) { found . add ( entry ) ; } } if ( ! found . isEmpty ( ) ) { throw failures . failure ( description , shouldNotContain ( actual , entries , found ) ) ; }


signature:
public class Maps { /** * Asserts that the actual map contain the given key .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param key the given key
 * @ throws AssertionError if the actual map is { @ code null } .
 * @ throws AssertionError if the actual map not contains the given key . */
public < K > void assertContainsKey ( Description description , Map < ? , ? > actual , K key ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! actual . containsKey ( key ) ) { throw failures . failure ( description , shouldContainKey ( actual , key ) ) ; }


signature:
public class Maps { /** * Asserts that the actual map not contains the given key .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param key the given key
 * @ throws AssertionError if the actual map is { @ code null } .
 * @ throws AssertionError if the actual map contains the given key . */
public < K > void assertDoesNotContainKey ( Description description , Map < ? , ? > actual , K key ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . containsKey ( key ) ) { throw failures . failure ( description , shouldNotContainKey ( actual , key ) ) ; }


signature:
public class Maps { /** * Asserts that the actual map contain the given value .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param value the given value
 * @ throws AssertionError if the actual map is { @ code null } .
 * @ throws AssertionError if the actual map not contains the given value . */
public < V > void assertContainsValue ( Description description , Map < ? , ? > actual , V value ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! actual . containsValue ( value ) ) { throw failures . failure ( description , shouldContainValue ( actual , value ) ) ; }


signature:
public class Maps { /** * Asserts that the actual map does not contain the given value .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param value the given value
 * @ throws AssertionError if the actual map is { @ code null } .
 * @ throws AssertionError if the actual map contains the given value . */
public < V > void assertDoesNotContainValue ( Description description , Map < ? , ? > actual , V value ) { } }

implementation: assertNotNull ( description , actual ) ; if ( actual . containsValue ( value ) ) { throw failures . failure ( description , shouldNotContainValue ( actual , value ) ) ; }


signature:
public class Maps { /** * Asserts that the actual map does not contain the duplicate values .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ throws AssertionError if the actual map is { @ code null } .
 * @ throws AssertionError if the actual map contains the given value . */
public < K , V > void assertDoesNotContainDuplicateValues ( Description description , Map < K , V > actual ) { } }

implementation: assertNotNull ( description , actual ) ; Collection < ? > duplicates = duplicatesFrom ( actual . values ( ) ) ; if ( ! duplicates . isEmpty ( ) ) { throw failures . failure ( description , shouldNotHaveDuplicates ( actual , duplicates ) ) ; }


signature:
public class Maps { /** * Asserts that the number of entries in the given { @ code Map } is equal to the expected one .
 * @ param description contains information about the assertion .
 * @ param actual the given { @ code Map } .
 * @ param expectedSize the expected size of { @ code actual } .
 * @ throws AssertionError if the given { @ code Map } is { @ code null } .
 * @ throws AssertionError if the number of entries in the given { @ code Map } is different than the expected one . */
public < K , V > void assertHasSize ( Description description , Map < K , V > actual , int expectedSize ) { } }

implementation: assertNotNull ( description , actual ) ; int sizeOfActual = actual . size ( ) ; if ( sizeOfActual != expectedSize ) { throw failures . failure ( description , shouldHaveSize ( actual , sizeOfActual , expectedSize ) ) ; }


signature:
public class BigDecimals { /** * Verifies that two BigDecimals are equal .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertEqual ( Description description , BigDecimal actual , BigDecimal expected ) { } }

implementation: checkNumberIsNotNull ( expected ) ; assertNotNull ( description , actual ) ; comparables . assertEqual ( description , actual , expected ) ;


signature:
public class BigDecimals { /** * Verifies that the actual value is zero .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsZero ( Description description , BigDecimal actual ) { } }

implementation: comparables . assertEqual ( description , actual , ZERO ) ;


signature:
public class BigDecimals { /** * Verifies that the actual value is not zero .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsNotZero ( Description description , BigDecimal actual ) { } }

implementation: comparables . assertNotEqual ( description , actual , ZERO ) ;


signature:
public class BigDecimals { /** * Verifies that the actual value is positive .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsPositive ( Description description , BigDecimal actual ) { } }

implementation: comparables . assertGreaterThan ( description , actual , ZERO ) ;


signature:
public class BigDecimals { /** * Verifies that the actual value is negative .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsNegative ( Description description , BigDecimal actual ) { } }

implementation: comparables . assertLessThan ( description , actual , ZERO ) ;


signature:
public class Not { /** * Creates a new < / code > { @ link Not } < / code > .
 * @ param condition the condition to inverse .
 * @ return The Not condition created . */
public static < T > Not < T > not ( Matcher < ? super T > condition ) { } }

implementation: return new Not < T > ( condition ) ;


signature:
public class ElementsShouldNotBeAtLeast { /** * Creates a new < / code > { @ link ElementsShouldNotBeAtLeast } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param times least time the condition should be verify .
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory elementsShouldNotBeAtLeast ( Object actual , int times , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotBeAtLeast ( actual , times , condition ) ;


signature:
public class ElementsShouldNotBe { /** * Creates a new < / code > { @ link ElementsShouldNotBe } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param satisfies elements that satisfies the condition
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory elementsShouldNotBe ( Object actual , Object satisfies , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotBe ( actual , satisfies , condition ) ;


signature:
public class FloatAssert { /** * Verifies that the actual value is equal to the given one , within a positive offset .
 * @ param expected the given value to compare the actual value to .
 * @ param offset the given positive offset .
 * @ return { @ code this } assertion object .
 * @ throws NullPointerException if the given offset is { @ code null } .
 * @ throws AssertionError if the actual value is { @ code null } .
 * @ throws AssertionError if the actual value is not equal to the given one . */
public FloatAssert isEqualTo ( float expected , Offset < Float > offset ) { } }

implementation: floats . assertEqual ( description , actual , expected , offset ) ; return this ;


signature:
public class ShouldBeLenientEqualByIgnoring { /** * Creates a new < / code > { @ link ShouldBeLenientEqualByIgnoring } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param rejectedFields fields name not matching
 * @ param expectedValues fields value not matching
 * @ param ignoredFields fields which are not base the lenient equality
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory shouldBeLenientEqualByIgnoring ( Object actual , List < String > rejectedFields , List < Object > expectedValues , List < String > ignoredFields ) { } }

implementation: if ( rejectedFields . size ( ) == 1 ) { if ( ignoredFields . isEmpty ( ) ) { return new ShouldBeLenientEqualByIgnoring ( actual , rejectedFields . get ( 0 ) , expectedValues . get ( 0 ) ) ; } else { return new ShouldBeLenientEqualByIgnoring ( actual , rejectedFields . get ( 0 ) , expectedValues . get ( 0 ) , ignoredFields ) ; } } else { if ( ignoredFields . isEmpty ( ) ) { return new ShouldBeLenientEqualByIgnoring ( actual , rejectedFields , expectedValues ) ; } else { return new ShouldBeLenientEqualByIgnoring ( actual , rejectedFields , expectedValues , ignoredFields ) ; } }


signature:
public class ShouldContainStringOnlyOnce { /** * Creates a new < code > { @ link ShouldContainStringOnlyOnce } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param sequence the String expected to be in { @ code actual } only once .
 * @ param occurences the number of occurrences of sequence in actual .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory shouldContainOnlyOnce ( String actual , String sequence , int occurences ) { } }

implementation: return new ShouldContainStringOnlyOnce ( actual , sequence , occurences ) ;


signature:
public class ElementsShouldNotHave { /** * Creates a new < / code > { @ link ElementsShouldNotHave } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param notSatisfies elements that not satisfies the condition
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static ErrorMessageFactory elementsShouldNotHave ( Object actual , Object notSatisfies , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotHave ( actual , notSatisfies , condition ) ;


signature:
public class ShouldBeEqualWithinOffset { /** * Creates a new < code > { @ link ShouldBeEqualWithinOffset } < / code > .
 * @ param < T > guarantees that the values used in this factory have the same type .
 * @ param actual the actual value in the failed assertion .
 * @ param expected the expected value in the failed assertion .
 * @ param offset the given positive offset .
 * @ param difference the effective difference between actual and expected .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < T extends Number > ErrorMessageFactory shouldBeEqual ( T actual , T expected , Offset < T > offset , T difference ) { } }

implementation: return new ShouldBeEqualWithinOffset ( actual , expected , offset , difference ) ;


signature:
public class Assertions { /** * Creates a new instance of < code > { @ link MapAssert } < / code > .
 * @ param actual the actual value .
 * @ return the created assertion object . */
public static < K , V > MapAssert assertThat ( Map < K , V > actual ) { } }

implementation: return new MapAssert ( actual ) ;


signature:
public class AbstractObjectAssert { /** * Verifies that the < em > actual < / em > value is the same as the given one .
 * @ param expected the given value to compare the < em > actual < / em > value to .
 * @ return { @ code this } assertion object .
 * @ throws AssertionError if the < em > actual < / em > value is not the same as the given one . */
public S isSameAs ( A expected ) { } }

implementation: objects . assertSame ( description , actual , expected ) ; return myself ;


signature:
public class AbstractObjectAssert { /** * Verifies that the < em > actual < / em > value is not the same as the given one .
 * @ param other the given value to compare the < em > actual < / em > value to .
 * @ return { @ code this } assertion object .
 * @ throws AssertionError if the < em > actual < / em > value is the same as the given one . */
public S isNotSameAs ( A other ) { } }

implementation: objects . assertNotSame ( description , actual , other ) ; return myself ;


signature:
public class AbstractObjectAssert { /** * Verifies that the < em > actual < / em > value is an instance of the given type .
 * @ param type the type to check the < em > actual < / em > value against .
 * @ return this assertion object .
 * @ throws NullPointerException if the given type is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is not an instance of the given type . */
public S isInstanceOf ( Class < ? > type ) { } }

implementation: objects . assertIsInstanceOf ( description , actual , type ) ; return myself ;


signature:
public class AbstractObjectAssert { /** * Verifies that the < em > actual < / em > value is not an instance of the given type .
 * @ param type the type to check the < em > actual < / em > value against .
 * @ return this assertion object .
 * @ throws NullPointerException if the given type is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is an instance of the given type . */
public S isNotInstanceOf ( Class < ? > type ) { } }

implementation: objects . assertIsNotInstanceOf ( description , actual , type ) ; return myself ;


signature:
public class AbstractObjectAssert { /** * Verifies that the < em > actual < / em > value is an instance of any of the given types .
 * @ param types the types to check the < em > actual < / em > value against .
 * @ return this assertion object .
 * @ throws NullPointerException if the given array is { @ code null } .
 * @ throws IllegalArgumentException if the given array is empty .
 * @ throws NullPointerException if the given array has { @ code null } elements .
 * @ throws AssertionError if the actual < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the actual < em > actual < / em > value is not an instance of any of the given types . */
public S isInstanceOfAny ( Class < ? > ... types ) { } }

implementation: objects . assertIsInstanceOfAny ( description , actual , types ) ; return myself ;


signature:
public class AbstractObjectAssert { /** * Verifies that the < em > actual < / em > value is not an instance of any of the given types .
 * @ param types the types to check the < em > actual < / em > value against .
 * @ return this assertion object .
 * @ throws NullPointerException if the given array is { @ code null } .
 * @ throws IllegalArgumentException if the given array is empty .
 * @ throws NullPointerException if the given array has { @ code null } elements .
 * @ throws AssertionError if the actual < em > actual < / em > value is an instance of any of the given types . */
public S isNotInstanceOfAny ( Class < ? > ... types ) { } }

implementation: objects . assertIsNotInstanceOfAny ( description , actual , types ) ; return myself ;


signature:
public class ShouldBeLenientEqualByAccepting { /** * Creates a new < / code > { @ link ShouldBeLenientEqualByAccepting } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param rejectedFields fields name not matching
 * @ param expectedValues fields value not matching
 * @ param acceptedFields fields on which is based the lenient equality
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory shouldBeLenientEqualByAccepting ( Object actual , List < String > rejectedFields , List < Object > expectedValues , List < String > acceptedFields ) { } }

implementation: if ( rejectedFields . size ( ) == 1 ) { return new ShouldBeLenientEqualByAccepting ( actual , rejectedFields . get ( 0 ) , expectedValues . get ( 0 ) , acceptedFields ) ; } else { return new ShouldBeLenientEqualByAccepting ( actual , rejectedFields , expectedValues , acceptedFields ) ; }


signature:
public class ByteArrayAssert { /** * Verifies that the given array contains the given value at the given index .
 * @ param value the value to look for .
 * @ param index the index where the value should be stored in the given array .
 * @ return { @ code this } assertion object .
 * @ throws AssertionError if the given array is { @ code null } or empty .
 * @ throws NullPointerException if the given { @ code Index } is { @ code null } .
 * @ throws IndexOutOfBoundsException if the value of the given { @ code Index } is equal to or greater than the size of
 * the given array .
 * @ throws AssertionError if the given array does not contain the given value at the given index . */
public ByteArrayAssert contains ( byte value , Index index ) { } }

implementation: arrays . assertContains ( description , actual , value , index ) ; return this ;


signature:
public class BasicErrorMessageFactory { /** * { @ inheritDoc } */
@ Override public String create ( Description d ) { } }

implementation: return formatter . format ( d , format , arguments ) ;


signature:
public class ElementsShouldNotHaveAtMost { /** * Creates a new < / code > { @ link ElementsShouldNotHaveAtMost } < / code > .
 * @ param actual the actual value in the failed assertion .
 * @ param times least time the condition should be verify .
 * @ param condition the { @ code Condition } .
 * @ return the created { @ code ErrorMessageFactory } . */
public static < E > ErrorMessageFactory elementsShouldNotHaveAtMost ( Object actual , int times , Matcher < ? > condition ) { } }

implementation: return new ElementsShouldNotHaveAtMost ( actual , times , condition ) ;


signature:
public class Doubles { /** * Verifies that the actual value is equal to { @ code NaN } .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsNaN ( Description description , Double actual ) { } }

implementation: comparables . assertEqual ( description , actual , NaN ) ;


signature:
public class Doubles { /** * Verifies that the actual value is not equal to { @ code NaN } .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value . */
public void assertIsNotNaN ( Description description , Double actual ) { } }

implementation: comparables . assertNotEqual ( description , actual , NaN ) ;


signature:
public class Doubles { /** * Verifies that two doubles are equal within a positive offset . < br >
 * It does not rely on the custom comparisonStrategy ( if one is set ) because using an offset is already a specific
 * comparison strategy .
 * @ param description describes the information about the assertion .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value .
 * @ param offset the given positive < em > offset < / em > .
 * @ throws NullPointerException if the given < em > offset < / em > is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is { @ code null } .
 * @ throws AssertionError if the < em > actual < / em > value is not equal to the < em > expected < / em > one . */
public void assertEqual ( Description description , Double actual , Double expected , Offset < Double > offset ) { } }

implementation: checkOffsetIsNotNull ( offset ) ; checkNumberIsNotNull ( expected ) ; assertNotNull ( description , actual ) ; if ( ! isEqualTo ( actual , expected , offset ) ) { throw failures . failure ( description , shouldBeEqual ( actual , expected , offset , abs ( expected . doubleValue ( ) - actual . doubleValue ( ) ) ) ) ; }


signature:
public class Doubles { /** * Verifies that two doubles are not equal .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value .
 * @ param offset the given positive < em > offset < / em > . */
public void assertNotEqual ( Description description , Double actual , Double expected , Offset < Double > offset ) { } }

implementation: checkOffsetIsNotNull ( offset ) ; checkNumberIsNotNull ( expected ) ; assertNotNull ( description , actual ) ; if ( isEqualTo ( actual , expected , offset ) ) { throw failures . failure ( description , shouldNotBeEqual ( actual , expected ) ) ; }


signature:
public class Doubles { /** * Verifies that the actual value is not greater than the expected .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertNotGreaterThan ( Description description , Double actual , double expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( isGreaterThan ( actual , expected ) ) { throw failures . failure ( description , shouldNotBeGreaterThan ( actual , expected ) ) ; }


signature:
public class Doubles { /** * Verifies that the actual value is less than the expected .
 * @ param description the description of the < em > actual < / em > value .
 * @ param actual the < em > actual < / em > value .
 * @ param expected the < em > expected < / em > value . */
public void assertLessThan ( Description description , Double actual , double expected ) { } }

implementation: assertNotNull ( description , actual ) ; if ( ! isLessThan ( actual , expected ) ) { throw failures . failure ( description , shouldBeLessThan ( actual , expected ) ) ; }