I have a class for users

```
public class User {

@SerializedName("username")
private String userName;
@SerializedName("email")
private String email;
@SerializedName("bags")
private List<Bag> bags;
.
.
.

```

And I have this data in my firebase DB

[![enter image description here](https://i.stack.imgur.com/CPNKT.png)](https://i.stack.imgur.com/CPNKT.png)

Before I added the "bags" items, the object was created fine, I'm using this method for retrieving the user by the uid:

```
public void retrieveUserByUid(String uid, FirebaseRetrieveUserListener listener){
    Query userQuery = dbReference.child(FirebaseChild.users.name()).child(uid);

    final FirebaseRetrieveUserListener dataListener = listener;

    userQuery.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            User user = dataSnapshot.getValue(User.class);
            dataListener.retrieveUserByUid(user);
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });
}

```

As I said, this worked without the "bags" item, when I put it, the error I'm getting is this.

```
com.google.firebase.database.DatabaseException: Expected a List while deserializing, but got a class java.util.HashMap

```

This happens when I try to do this

```
 User user = dataSnapshot.getValue(User.class);

```

I've searched a lot about how to retrieve a list, but all I find is retrieving a single list object, not a "mixed" object with "single data" and a list.