Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.