The Helly-type property of non-trivial intervals on a tree