A crazy thought: How about returning a dynamic proxy for TypeVariable? That way we could make sure the code compiles with Java 7 and 8 (which is nice for detecting possible regressions) while not requiring a separate Java 8 branch of the code base (we can't implement the new method just as is as its return type was added in Java 8, so it wouldn't compile on Java 7 anymore). It may be a bit hack-ish, but I wouldn't have a problem with that as this is in a test only and it would allow us to move forward in a non-interuptive manner.
|