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 trialAbby Schoeller
Courses Plus Student 6,187 PointsNo suitable method found...
What do I put inside of the Comparator to find the minimum. I already have a stream of integers.
public static OptionalInt getLowestHomeValueIndexDeclaratively(List<HousingRecord> records) {
// TODO: Create a stream off the records
// TODO: Map the stream to an IntStream on HousingRecord.getCurrentHomeValueIndex
to expose new methods
// TODO: Return the minimum value from the stream. It should be an optional because records could be empty.
System.out.println( records.stream() .map(HousingRecord:: getCurrentHomeValueIndex) .min(Comparator.comparing()) ); }
Am I trying to compare too many integers in one statement? i keep getting this error
no suitable method found for comparing(no arguments) method Comparator.<T#1,U#1>comparing(Function<? super T#1,? extends U#1>,Comparator<? super U#1>) is not applicable (cannot infer type-variable(s) T#1,U#1 (actual and formal argument lists differ in length)) method Comparator.<T#2,U#2>comparing(Function<? super T#2,? extends U#2>) is not applicable (cannot infer type-variable(s) T#2,U#2 (actual and formal argument lists differ in length)) where T#1,U#1,T#2,U#2 are type-variables: T#1 extends Object declared in method <T#1,U#1>comparing(Function<? super T#1,? extends U#1>,Comparator<? super U#1>) U#1 extends Object declared in method <T#1,U#1>comparing(Function<? super T#1,? extends U#1>,Comparator<? super U#1>) T#2 extends Object declared in method <T#2,U#2>comparing(Function<? super T#2,? extends U#2>) U#2 extends Comparable<? super U#2> declared in method <T#2,U#2>comparing(Function<? super T#2,? extends U#2>)