implemented the intersection and difference of intervals and wrote the
test classes