Skip to content

Instantly share code, notes, and snippets.

Last active Apr 29, 2016
What would you like to do?
import static java.lang.Integer.parseInt;
import static java.util.Comparator.comparing;
import static;
import static;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Record {
int id;
String course;
int grade;
Record(String record) {
String[] values = record.split("\\|"); = parseInt(values[0]);
this.course = values[1];
this.grade = parseInt(values[2]);
public static void main(String[] args) throws IOException {
.collect(groupingBy(record -> record.course, minBy(comparing(record ->
.forEach((course, record) -> System.out.printf("%s %d%n", course, record.get().grade));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment