Code example for Range

Methods: containsencloseslowerEndpointupperEndpoint

0
 
import com.google.common.collect.Range;
import org.junit.Test; 
 
import static org.junit.Assert.assertEquals; 
 
public class ScrollUtilTest { 
  @Test
  public void rangeContainment() { 
    assertDelta(0, 0, 100, 1, 2); 
  } 
 
  @Test
  public void rangeLargeThanContainer() { 
    assertDelta(-1, 0, 1, 1, 100); 
  } 
 
  @Test
  public void containerContainsEnd() { 
    assertDelta(1, 10, 12, 9, 11); 
  } 
 
  @Test
  public void containerContainsStart() { 
    assertDelta(-1, 10, 12, 11, 13); 
  }