@Test public void testIntersect() { AddressRange r2 = new AddressRangeImpl(addr(0), addr(30)); AddressRange r1 = new AddressRangeImpl(addr(5), addr(20)); AddressRange r3 = r1.intersect(r2); assertNotNull(r3); Assert.assertEquals(addr(5), r3.getMinAddress()); Assert.assertEquals(addr(20), r3.getMaxAddress()); r1 = new AddressRangeImpl(addr(0), addr(30)); r1 = new AddressRangeImpl(addr(40), addr(50)); r3 = r1.intersect(r2); assertNull(r3); r1 = new AddressRangeImpl(addr(0), addr(30)); r1 = new AddressRangeImpl(addr(30), addr(50)); r3 = r1.intersect(r2); assertNotNull(r3); Assert.assertEquals(addr(30), r3.getMinAddress()); Assert.assertEquals(addr(30), r3.getMaxAddress()); }
@Override public AddressRange intersect(AddressRange range) { return intersectRange(range.getMinAddress(), range.getMaxAddress()); }
AddressRangeImpl implements AddressRange, Serializable { @Override public AddressRange intersect(AddressRange range) { return intersectRange(range.getMinAddress(), range.getMaxAddress()); } }
AddressRangeImpl implements AddressRange, Serializable { @Override public AddressRange intersect(AddressRange range) { return intersectRange(range.getMinAddress(), range.getMaxAddress()); } AddressRangeImpl(AddressRange range);  AddressRangeImpl(Address start, Address end);  AddressRangeImpl(Address start, int length); }
AddressRangeImpl implements AddressRange, Serializable { @Override public AddressRange intersect(AddressRange range) { return intersectRange(range.getMinAddress(), range.getMaxAddress()); } AddressRangeImpl(AddressRange range);  AddressRangeImpl(Address start, Address end);  AddressRangeImpl(Address start, int length); @Override boolean contains(Address addr); @Override AddressSpace getAddressSpace(); @Override Address getMinAddress(); @Override Address getMaxAddress(); @Override long getLength(); @Override BigInteger getBigLength(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(Address addr); @Override String toString(); @Override boolean intersects(AddressRange range); @Override boolean intersects(Address start, Address end); @Override AddressRange intersect(AddressRange range); @Override AddressRange intersectRange(Address start, Address end); @Override int compareTo(AddressRange o); }
AddressRangeImpl implements AddressRange, Serializable { @Override public AddressRange intersect(AddressRange range) { return intersectRange(range.getMinAddress(), range.getMaxAddress()); } AddressRangeImpl(AddressRange range);  AddressRangeImpl(Address start, Address end);  AddressRangeImpl(Address start, int length); @Override boolean contains(Address addr); @Override AddressSpace getAddressSpace(); @Override Address getMinAddress(); @Override Address getMaxAddress(); @Override long getLength(); @Override BigInteger getBigLength(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(Address addr); @Override String toString(); @Override boolean intersects(AddressRange range); @Override boolean intersects(Address start, Address end); @Override AddressRange intersect(AddressRange range); @Override AddressRange intersectRange(Address start, Address end); @Override int compareTo(AddressRange o);  }