@ Override public boolean containsInstance ( int value , T instance ) { if ( root == null ) return false ; if ( value < first . value ) return false ; if ( value > last . value ) return false ; if ( value == first . value && instance == first . element ) return true ; if ( value == last . value && instance == last . element ) return true ; return containsInstance ( root , value , instance ) ; }
Returns true if the given key exists in the tree and its associated value is the given element . Comparison of the element is using the == operator .