Fix generic error with type erasure occurred in JDK7