added unit test for inferring intervals