You could store this information in a Map. Suppose you have an User class and an Artist class, you could create a Map<User, Set<Artist>> that would keep a set (or list if you prefer) of artists for each user.
To create the map you do:
Map<User, Set<Artist>> artistsFromUser = new HashMap<>();
If you just need to store the usernames and artist names as strings, your map can be:
Map<String, Set<String>> artistsFromUser = new HashMap<>();
Then you will need to run through your file, transforming each user -> artist pair into an user object and an artist object. After that, you can store the artist using the corresponding user reference:
// Retrieve the set of artists for this user
// Substitute String for Artist here if you're just storing the names
Set<Artist> artists = artistsFromUser.get(user);
if (artists == null) {
// If the set was not created for this user yet
// you need to create it and store it in the map
artists = new HashSet<>();
artistsFromUser.put(user, artists);
}
// Add the new artist to the set
artists.add(artist);
Printing your output would be as simple as doing:
System.out.println(user + " has listened to " + artistsFromUser.get(user));