Consider the following: Java has an interface called Iterable, which many types of Java collections implement. Now, if we found a way to make it follow the iterable protocol, we could easily iterate over any Java class in TypeScript.
This is where the Behavior API comes in. You define a predicate, and an apply as a behavior. Once that Java class is initialized somewhere, if it meets the predicate, it will be applied.
Keep in mind this is the TypeScript API. There will almost certainly also be a Java API.