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

Collecting 3 NES scores Failing

I think there's an issue with all these Gradle based code submission tasks. I'm pretty certain my code itself is correct, but every time I try to submit the code to these challenges, it says:

"Oh no! We encountered an error with your last submission."

My code:

  public static List<Score> getFirstThreeNintendoScoresDeclaratively(List<Score> scores) {
    // TODO: Filter the scores stream to be of platform 'Nintendo Entertainment System'
    // TODO: Limit it to 3 scores
    // TODO: Return a newly collected list using the collect method

    return   scores.stream()
      .filter(score -> score.getPlatform().equals("Nintendo Entertainment System"))
      .limit(3)
      .collect(Collectors.toList());
  }

my output locally in my IDE:

4:12:39 PM: Executing ':Main.main()'...

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:Main.main()
There are 3549 total scores. 

Imperatively - First 3 'Nintendo Entertainment System' Scores
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='168,120', player='David Stuart', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='144,300', player='Patrick Stanley', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='126,900', player='Jason Kelly', platform='Nintendo Entertainment System'}
Declaratively - First 3 'Nintendo Entertainment System' Scores
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='168,120', player='David Stuart', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='144,300', player='Patrick Stanley', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='126,900', player='Jason Kelly', platform='Nintendo Entertainment System'}

BUILD SUCCESSFUL

Total time: 0.252 secs
4:12:40 PM: Execution finished ':Main.main()'.

This happens to the for each challenge and the using method references, and filtering high scores challenges as well!

1 Answer

Will Dutcher
Will Dutcher
2,056 Points

It seems that the Team Treehouse staff is severely poor at answering questions in regards to these upload questions. Every submission is met with "Oh no! We encountered an error with your last submission." The code you've written, to me, appears to be fine. They just haven't updated their applications to accept newer versions of gradle. It's not 2015/2016 anymore...not sure why they stopped supporting this. I think I'm done with this platform once this month's membership rolls off. Also, if you google Craig Dennis, he left for Twilio in 2019. Might also want to google "Medium what happened team treehouse" if you want an interesting read. A huge shame, because I was really digging their teaching methods and the layout. But there is seemingly no support, orversight, curriculum update, or apparent hope for improvement. Good luck.