def consistent_with_tree(ete_tree, h1, h2, h3, h4):
    """"
    Returns True if the lineages have relationship
       /-h4  
      /
     |   /-h3
     |--|
         |   /-h2
          \-|
             \-h1

    and h1 != h2.
    Returns False otherwise.
    """
    if h1 == h2:
        return False
    try:
        h1h2 = ete_tree.get_common_ancestor([h1,h2])
        h1h2h3 = ete_tree.get_common_ancestor([h1,h2,h3])
        h1h2h3h4 = ete_tree.get_common_ancestor([h1,h2,h3,h4])
    except ValueError:
        #One of the samples not in tree.
        return False
    return bool(h1h2.get_distance(h1h2h3, topology_only=True)) \
            & bool(h1h2h3.get_distance(h1h2h3h4, topology_only=True))