/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.util.stream.Collectors;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		List<String> listKeys = new ArrayList<>(List.of("A", "B", "C"));

        Map<User, Long> mapUsers = new HashMap<>();
        mapUsers.put(new User("Annie", "A"), 23L);
        mapUsers.put(new User("Paul", "C"), 16L);

        List<UserCount> listRes = listKeys.stream()
                .map(key -> {
                    User user = mapUsers.keySet().stream().filter(u -> u.getKey().equals(key)).findFirst().orElse(null);
                    return new UserCount(key, user != null ? mapUsers.get(user) : 0L);
                })
                .collect(Collectors.toList());

        System.out.println(listRes);
	}
}

class User {
    private String name, key;

    public User(String name, String key) {
        this.name = name;
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public String getKey() {
        return key;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) return true;
        if (obj == null) return false;
        if (obj.getClass() != getClass()) return false;
        User other = (User) obj;
        return Objects.equals(name, other.getName()) && Objects.equals(key, other.getKey());
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, key);
    }

    public String toString() {
        return String.format("%s - %s", name, key);
    }
}

class UserCount {
    private String key;
    private long count;

    public UserCount(String key, long count) {
        this.key = key;
        this.count = count;
    }

    public String getKey() {
        return key;
    }

    public long getCount() {
        return count;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) return true;
        if (obj == null) return false;
        if (obj.getClass() != getClass()) return false;
        UserCount other = (UserCount) obj;
        return Objects.equals(key, other.getKey()) && Objects.equals(count, other.getCount());
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, count);
    }

    public String toString() {
        return String.format("%s - %d", key, count);
    }
}