java check if type implements interface