-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
25 lines (22 loc) · 853 Bytes
/
App.java
File metadata and controls
25 lines (22 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package com.tinyield;
public class App {
public static void main(String[] args) {
Sek<Song> songs = Sek.of(
new Song("505", "Alternative"),
new Song("Amsterdam", "Alternative"),
new Song("Mural", "Hip-Hop"));
Sek<Artist> artists = Sek.of(
new Artist("Arctic Monkeys", "band"),
new Artist("Nothing But Thieves", "band"),
new Artist("Lupe Fiasco", "solo-artist"));
songs
.filterNot(song -> song.getName().startsWith("A"))
.map(Song::getName)
.zip(artists.distinctBy(Artist::getKind).map(Artist::getName))
.map(pair -> String.format("%s by %s", pair.getFirst(), pair.getSecond()))
.forEach(System.out::println);
}
}