-3

My linter advises me to refactor this using lambda expressions, but I can't figure out how to do it for this piece of code

        return new Iterable<Message>() {
            @Override
            public Iterator<Message> iterator() {
                return new UnprocessedIterator(message);
            }
        };
Jelte
  • 9
  • 4
  • 7
    Hint: a decent IDE, like IntelliJ not only tells you about "this could be a lambda", but also does the conversion for you, most of the time. – GhostCat Mar 31 '21 at 14:33

1 Answers1

0

Something like return () -> new UnprocessedIterator(message); should work.

talex
  • 17,973
  • 3
  • 29
  • 66