You don´t get a Compile Error because you are casting here:
public <T extends SuperService> T getServiceType(ServiceType type){
switch (type){
case CUSTOMER:return (T) new CustomerServiceImpl();
case ITEM:return (T) new ItemServiceImpl();
case ORDER:return (T) new OrderServiceImpl();
}
return null;
}
With type erasure in place you basically casting all the Impls to SuperService.
Now since SuperService is an interface you won´t get a compile error, but you will get a runtime error!
It basically boils down to this:
Casting to unrelated interfaces does not give you a compile error.
More info can be found here: Why does it compile when casting to an unrelated interface?