Guava Equivalence.Wrapper - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava Equivalence.Wrapper class.

This code example shows how to use the following methods:
  private static final Equivalence<String> LENGTH_EQUIVALENCE = Equivalence.equals()
      .onResultOf(LengthFunction.INSTANCE);
 
  public void testWrap() { 
    new EqualsTester() 
        .addEqualityGroup( 
            LENGTH_EQUIVALENCE.wrap("hello"),
            LENGTH_EQUIVALENCE.wrap("hello"),
            LENGTH_EQUIVALENCE.wrap("world"))
        .addEqualityGroup( 
            LENGTH_EQUIVALENCE.wrap("hi"),
            LENGTH_EQUIVALENCE.wrap("yo"))
        .addEqualityGroup( 
            LENGTH_EQUIVALENCE.wrap(null),
            LENGTH_EQUIVALENCE.wrap(null))
        .addEqualityGroup(Equivalence.equals().wrap("hello"))
        .addEqualityGroup(Equivalence.equals().wrap(null))
        .testEquals(); 
  } 
 

4
CodeRank
See Code Examples for Guava Equivalence.Wrapper Methods: