Java Java Data Structures Efficiency! Changing Course

James Adamski
James Adamski
3,027 Points

Has anyone seen a test error - Map can't be converted to Map

JavaTester.java:122: error: incompatible types: Map> cannot be converted to Map vidz = qf.videosByTitle(course); ^ 1 error

The error I am getting seems to be coming from the test unit attached to our course. Has anyone seen this before?

Can you share your code so we can get a bit more information on what is going on?

2 Answers

James Adamski
James Adamski
3,027 Points

I got that error when I started the the following with Map instead of TreeMap on the right side of the equation. Can you post your code?

Map<String, List<Song>> byArtist = new TreeMap<>();

James Adamski
James Adamski
3,027 Points

The problem seems to be that the test code is expecting a different implementation than the one you are providing.

Try.

Map<String, List<Song>> byArtist = new TreeMap<String, List<Song>>();

Can you share the link to the challenge?