The data in firebase is like the following

I want to get the data tagged as userId
The error message contains the gist of it:
Expected a List while deserializing, but got a class java.util.HashMap
If you look at your database, you see a collection of keys+values. In Java that translates to a Map and not to a List.
If you're only interested in the values, you need to handle the conversion from the Map to the List in your code:
public void onDataChange(DataSnapshot dataSnapshot) {
GenericTypeIndicator
Or simpler:
public void onDataChange(DataSnapshot dataSnapshot) {
List list = new ArrayList();
for (DataSnapshot child: dataSnapshot.getChildren()) {
list.add(child.getValue(Friends.class));
}
}