Stream -> List & Map

 Map map = Objects.requireNonNull(users).stream().collect(Collectors.toMap(User::getUser_id, User::getUser_name));

taskList.stream().map(Task::getTask_id).collect(Collectors.toList());

        List fieldNames = Arrays.stream(aClass.getDeclaredFields()).map(Field::getName).map(String::toUpperCase).collect(Collectors.toList());

br.lines().collect(Collectors.joining(System.lineSeparator()));

你可能感兴趣的:(Stream -> List & Map)