#59 Users from Groups Starting with “X”

Companies:
VTB
Themes:
JavaStreams & LambdasPractice

Return the list of users who belong to a group whose name starts with "X":

Java
class SomeConsumer {
    public List<User&glt; consume(Stream<User> usersStream) {
        //TODO
        return usersStream;
    }
}

@Data
class User {
    private String username;
    private Integer age;
    private List groups;
}

@Data
class Group {
    private String name;
    private String description;
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in