Force cast some generic types to comply with maven compiler