I assume that you are using JDK 7. If so, then new DynQSimModule<>(AMoDQSimProvider.class) will not compile because Java 7 does not use target typing to infer the type of the parameter passed.
new DynQSimModule<? extends Mobsim>(AMoDQSimProvider.class) new DynQSimModule<? extends Mobsim>(AMoDQSimProvider.class) also not compile, because you cannot use the map legend in object creation.
To solve this problem, you must specify the exact type in new DynQSimModule<>(...) or, if possible, you can upgrade to Java 8, which provides a target type inference function.
For example, the code below will not compile in Java 7, but will compile in Java 8 +:
public static void test(List<String> list) {
Learn more about Java 8 Target type query .
source share