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 Introduction to Functional Programming Meet Streams Collecting 3 NES Scores

Claudio Rodrigues
Claudio Rodrigues
3,989 Points

All my tests are passing through in InteliJ but for some reason it always fails when I upload...

I have created the required logic and all my tests work well in Java... when I upload it just fails repeatedly ... Can someone help ?

private static boolean isNintendo (Score score) { String Platforms = score.getPlatform(); return Platforms.contains("Nintendo Entertainment System"); }

public static List<Score> getFirstThreeNintendoScoresDeclaratively(List<Score> scores) { return scores.stream() .filter(Main::isNintendo) .limit(3) .collect(Collectors.toList());

}

1 Answer

Is it still giving you problems? You look like you have the correct code. What I did was have string be singular ('Platform') and not plural ('Platforms'). It passed both tests (IntelliJ and Treehouse) for me.