[XLS-233] Fix unit tests.

Parameterized types such as <S extends Comparable<S>> causing infinite recursion otherwise.