Keep getting this error when compiling using Maven:
type parameters of X cannot be determined; no unique maximal instance exists for type variable X wit
This issue can occur when your code is generic and it calls another method that has a generic return type. Sometimes the compiler gets confused trying to figure out how to resolve the method call / return type.
It can be resolved by adding an explicit cast to your code.
// Old code:
public T getValue() {
return otherMethod(); // otherMethod has the signature: