test_class.file: src/server/src/test/java/io/cassandrareaper/service/RingRangeTest.java
test_class.identifier: RingRangeTest
test_case.body: @Test
    public void testEncloses() throws Exception {
      RingRange r0To20 = new RingRange(BigInteger.valueOf(0L), BigInteger.valueOf(20L));
  
      RingRange r5To15 = new RingRange(BigInteger.valueOf(5L), BigInteger.valueOf(15L));
      assertTrue(r0To20.encloses(r5To15));
  
      RingRange r5To25 = new RingRange(BigInteger.valueOf(5L), BigInteger.valueOf(25L));
      assertFalse(r0To20.encloses(r5To25));
  
      RingRange r190To25 = new RingRange(BigInteger.valueOf(190L), BigInteger.valueOf(25L));
      assertFalse(r0To20.encloses(r190To25));
  
      RingRange r0To15 = new RingRange(BigInteger.valueOf(0L), BigInteger.valueOf(15L));
      assertTrue(r0To20.encloses(r0To15));
  
      RingRange r190To15 = new RingRange(BigInteger.valueOf(190L), BigInteger.valueOf(15L));
      assertFalse(r0To20.encloses(r190To15));
  
      RingRange r190To0 = new RingRange(BigInteger.valueOf(190L), BigInteger.valueOf(0L));
      assertFalse(r0To20.encloses(r190To0));
  
      RingRange r15To20 = new RingRange(BigInteger.valueOf(15L), BigInteger.valueOf(20L));
      assertTrue(r0To20.encloses(r15To20));
  
      assertTrue(r0To20.encloses(r0To20));
  
      RingRange r20To25 = new RingRange(BigInteger.valueOf(20L), BigInteger.valueOf(25L));
      assertFalse(r0To20.encloses(r20To25));
  
      RingRange r190To20 = new RingRange(BigInteger.valueOf(190L), BigInteger.valueOf(20L));
      assertFalse(r190To20.encloses(r5To25));
  
      RingRange r200To10 = new RingRange(BigInteger.valueOf(200L), BigInteger.valueOf(10L));
      assertTrue(r190To20.encloses(r200To10));
  
      RingRange r0To2 = new RingRange(BigInteger.valueOf(0L), BigInteger.valueOf(2L));
      RingRange r5To190 = new RingRange(BigInteger.valueOf(5L), BigInteger.valueOf(190L));
      assertFalse(r0To2.encloses(r5To190));
  
      // 0_0 should enclose almost everything, but is not enclosed by anything
      RingRange r15To5 = new RingRange(BigInteger.valueOf(15L), BigInteger.valueOf(5L));
      RingRange r0To0 = new RingRange(BigInteger.valueOf(0L), BigInteger.valueOf(0L));
      assertTrue(r0To0.encloses(r0To20));
      assertTrue(r0To0.encloses(r15To20));
      // the exception is that 0_0 does not enclose 15_5
      // this is because 0_0 range means one node in the cluster, and that node can't become
      // a repair coordinator for segment 15_5. This is not a biggie though, because we
      // generate the segments carefully, and prevent situation like this
      assertFalse(r0To0.encloses(r15To5));
      assertTrue(r0To0.encloses(r190To0));
  
      assertFalse(r0To20.encloses(r0To0));
      assertFalse(r15To20.encloses(r0To0));
      assertFalse(r5To15.encloses(r0To0));
      assertFalse(r190To0.encloses(r0To0));
    }
test_case.class_method_signature: RingRangeTest.testEncloses()
test_case.full_signature: @Test public void testEncloses()
test_case.identifier: testEncloses
test_case.invocations: valueOf valueOf valueOf valueOf assertTrue encloses valueOf valueOf assertFalse encloses valueOf valueOf assertFalse encloses valueOf valueOf assertTrue encloses valueOf valueOf assertFalse encloses valueOf valueOf assertFalse encloses valueOf valueOf assertTrue encloses assertTrue encloses valueOf valueOf assertFalse encloses valueOf valueOf assertFalse encloses valueOf valueOf assertTrue encloses valueOf valueOf valueOf valueOf assertFalse encloses valueOf valueOf valueOf valueOf assertTrue encloses assertTrue encloses assertFalse encloses assertTrue encloses assertFalse encloses assertFalse encloses assertFalse encloses assertFalse encloses
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEncloses()
focal_class.declarator: START_COMPARATOR
        = (RingRange o1, RingRange o2) -> o1.start.compareTo(o2.start)
focal_class.modifier: public static final
focal_class.original_string: public static final Comparator<RingRange> START_COMPARATOR
        = (RingRange o1, RingRange o2) -> o1.start.compareTo(o2.start);
focal_class.type: Comparator<RingRange>
focal_class.var_name: START_COMPARATOR
focal_class.declarator: start
focal_class.modifier: private final
focal_class.original_string: private final BigInteger start;
focal_class.type: BigInteger
focal_class.var_name: start
focal_class.declarator: end
focal_class.modifier: private final
focal_class.original_string: private final BigInteger end;
focal_class.type: BigInteger
focal_class.var_name: end
focal_class.file: src/server/src/main/java/io/cassandrareaper/service/RingRange.java
focal_class.identifier: RingRange
focal_class.class_method_signature: RingRange.RingRange(BigInteger start, BigInteger end)
focal_class.full_signature: public  RingRange(BigInteger start, BigInteger end)
focal_class.identifier: RingRange
focal_class.modifiers: public
focal_class.parameters: (BigInteger start, BigInteger end)
focal_class.signature:  RingRange(BigInteger start, BigInteger end)
focal_class.class_method_signature: RingRange.RingRange(String... range)
focal_class.full_signature: public  RingRange(String... range)
focal_class.identifier: RingRange
focal_class.modifiers: public
focal_class.parameters: (String... range)
focal_class.signature:  RingRange(String... range)
focal_class.class_method_signature: RingRange.getStart()
focal_class.full_signature: public BigInteger getStart()
focal_class.identifier: getStart
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BigInteger
focal_class.signature: BigInteger getStart()
focal_class.class_method_signature: RingRange.getEnd()
focal_class.full_signature: public BigInteger getEnd()
focal_class.identifier: getEnd
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BigInteger
focal_class.signature: BigInteger getEnd()
focal_class.class_method_signature: RingRange.span(BigInteger ringSize)
focal_class.full_signature: public BigInteger span(BigInteger ringSize)
focal_class.identifier: span
focal_class.modifiers: public
focal_class.parameters: (BigInteger ringSize)
focal_class.return: BigInteger
focal_class.signature: BigInteger span(BigInteger ringSize)
focal_class.class_method_signature: RingRange.encloses(RingRange other)
focal_class.full_signature: public boolean encloses(RingRange other)
focal_class.identifier: encloses
focal_class.modifiers: public
focal_class.parameters: (RingRange other)
focal_class.return: boolean
focal_class.signature: boolean encloses(RingRange other)
focal_class.class_method_signature: RingRange.isWrapping()
focal_class.full_signature: @JsonIgnore public boolean isWrapping()
focal_class.identifier: isWrapping
focal_class.modifiers: @JsonIgnore public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isWrapping()
focal_class.class_method_signature: RingRange.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: RingRange.merge(List<RingRange> ranges)
focal_class.full_signature: public static RingRange merge(List<RingRange> ranges)
focal_class.identifier: merge
focal_class.modifiers: public static
focal_class.parameters: (List<RingRange> ranges)
focal_class.return: RingRange
focal_class.signature: RingRange merge(List<RingRange> ranges)
focal_method.body: public boolean encloses(RingRange other) {
      if (!isWrapping()) {
        return !other.isWrapping()
            && SegmentGenerator.greaterThanOrEqual(other.start, start)
            && SegmentGenerator.lowerThanOrEqual(other.end, end);
      } else {
        return (!other.isWrapping()
            && (SegmentGenerator.greaterThanOrEqual(other.start, start)
            || SegmentGenerator.lowerThanOrEqual(other.end, end)))
            || (SegmentGenerator.greaterThanOrEqual(other.start, start)
            && SegmentGenerator.lowerThanOrEqual(other.end, end));
      }
    }
focal_method.class_method_signature: RingRange.encloses(RingRange other)
focal_method.full_signature: public boolean encloses(RingRange other)
focal_method.identifier: encloses
focal_method.invocations: isWrapping isWrapping greaterThanOrEqual lowerThanOrEqual isWrapping greaterThanOrEqual lowerThanOrEqual greaterThanOrEqual lowerThanOrEqual
focal_method.modifiers: public
focal_method.parameters: (RingRange other)
focal_method.return: boolean
focal_method.signature: boolean encloses(RingRange other)