Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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?