Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Java 15 Features
List<Merchant> findTopMerchants(List<Merchant> merchants, int month) {
// Local record
record MerchantSales(Merchant merchant, double sales) {}
.map(merchant -> new MerchantSales(merchant, computeSales(merchant, month)))
.sorted((m1, m2) ->, m1.sales()))
String html = "<html>\n" +
" <body>\n" +
" <p>Hello, world</p>\n" +
" </body>\n" +
record Point(int x, int y) { }
String html = """
<p>Hello, world</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment