How ,to get type of instance_name

Therer is my code i want to check type of instance (master_interface), so for making this, what is the right way to follow ?

ahb_interface master_interface ; 
if (master_interface instanceof ahb_interface) begin 
    $display ("Ok") ; 
  end 
  else 
    $display ("NO");