i want to cast `List<HashMap<String, Object>>` into `Set<StudentInfo>`

i have method 

```
public List<HashMap<String,Object>> getStudentData(studentId);

```

i want to convert the result into Set so i used 

```
Set<StudentInfo> studentFilteredInfo = new HashSet<>();
List<Map<String, Object>> studentCompleteRecord = getStudentData(1005);
studentFilteredInfo.addAll((Collection<? extends StudentInfo>studentCompleteRecord ));

```

initially when i executed on localhost it with java 8, eclipse and tomcat 8 it is working fine.

when i tried to build it with maven 

```
mvn clean package

```

it will through an Error:

incompatible types: `java.util.List<java.util.Map<java.lang.String,java.lang.Object>>` 

```
cannot be converted to java.util.Collection<? extends com.school.model.StudentInfo>

```