How to Run and Different Code Paths Based on Specialisation

In using a framework like FastUtils with Scala, how do you generate the appropriate code based on the effective specialization as the framework itself has specialised data structures? I.e., how you you programmatically figure out what is being specialized and execute the appropriate code? So how do you deal with path related typing in such cases.

Do note that although the implementation of add always looks the same, the method being called on data is a different overload every time. If you would write this in a more polymorphic way, the most specific add method would not be chosen, and your Int or Char will need to be boxed.