Skip to content

Instantly share code, notes, and snippets.

Viktor Farcic vfarcic

Block or report user

Report or block vfarcic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View FlatCollection.java
package com.technologyconversations.java8exercises.streams;
import java.util.ArrayList;
import java.util.List;
import static java.util.stream.Collectors.toList;
public class FlatCollection {
public static List<String> transform7(List<List<String>> collection) {
View OldestPersonSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.OldestPerson.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
View OldestPerson.java
package com.technologyconversations.java8exercises.streams;
import java.util.Comparator;
import java.util.List;
public class OldestPerson {
public static Person getOldestPerson7(List<Person> people) {
Person oldestPerson = new Person("", 0);
for (Person person : people) {
View SumSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.Sum.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
View Sum.java
package com.technologyconversations.java8exercises.streams;
import java.util.List;
public class Sum {
public static int calculate7(List<Integer> numbers) {
int total = 0;
for (int number : numbers) {
total += number;
View KidsSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.Kids.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
View Kids.java
package com.technologyconversations.java8exercises.streams;
import java.util.*;
import static java.util.stream.Collectors.toSet;
public class Kids {
public static Set<String> getKidNames7(List<Person> people) {
Set<String> kids = new HashSet<>();
View PeopleStatsSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.PeopleStats.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
View PeopleStats.java
package com.technologyconversations.java8exercises.streams;
import java.util.IntSummaryStatistics;
import java.util.List;
public class PeopleStats {
public static Stats getStats7(List<Person> people) {
long sum = 0;
int min = people.get(0).getAge();
View PartitioningSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import java.util.Map;
import static com.technologyconversations.java8exercises.streams.Partitioning.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
You can’t perform that action at this time.