MigrateToStreamFix: explicit formatting removed (as formatted anyways automatically)

This commit is contained in:
Tagir Valeev
2018-05-30 18:23:38 +07:00
parent fa47bcb437
commit 3c2cd21d35
151 changed files with 175 additions and 176 deletions
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparing(Person::getName)).orElse(null);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparing(Person::getName)).orElse(null);
return maxPerson;
}
@@ -4,6 +4,6 @@ import java.util.*;
public class Main {
public void work(int[] ints) {
int max = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt >= 0).max().orElse(0);
int max = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt >= 0).max().orElse(0);
}
}
@@ -4,6 +4,6 @@ import java.util.*;
public class Main {
public void work(int[] ints) {
int max = Arrays.stream(ints).max().orElse(Integer.MIN_VALUE);
int max = Arrays.stream(ints).max().orElse(Integer.MIN_VALUE);
}
}
@@ -27,6 +27,6 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
}
}
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
return maxPerson;
}
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(p -> p.age)).orElse(null);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(p -> p.age)).orElse(null);
return maxPerson;
}
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
return maxPerson;
}
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
return maxPerson;
}
@@ -4,6 +4,6 @@ import java.util.*;
class Main {
public void work(long[] ints) {
long max = Arrays.stream(ints).filter(anInt -> anInt < 10).max().orElse(Long.MIN_VALUE);
long max = Arrays.stream(ints).filter(anInt -> anInt < 10).max().orElse(Long.MIN_VALUE);
}
}
@@ -4,6 +4,6 @@ import java.util.*;
public class Main {
public void work(int[] ints) {
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt <= 0).min().orElse(0);
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt <= 0).min().orElse(0);
}
}
@@ -4,6 +4,6 @@ import java.util.*;
public class Main {
public void work(Integer[] ints) {
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).mapToInt(anInt -> anInt).filter(anInt -> anInt <= 0).min().orElse(0);
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).mapToInt(anInt -> anInt).filter(anInt -> anInt <= 0).min().orElse(0);
}
}
@@ -4,6 +4,6 @@ import java.util.*;
public class Main {
public void work(int[] ints) {
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + 2343).filter(anInt -> anInt <= 0).min().orElse(0);
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + 2343).filter(anInt -> anInt <= 0).min().orElse(0);
}
}
@@ -4,6 +4,6 @@ import java.util.Arrays;
public class Main {
public void work(int[] ints) {
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + anInt * 2 - 10).filter(anInt -> anInt <= 0).min().orElse(0);
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + anInt * 2 - 10).filter(anInt -> anInt <= 0).min().orElse(0);
}
}
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.comparingInt(Person::getAge)).orElse(null);
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.comparingInt(Person::getAge)).orElse(null);
return minPerson;
}
@@ -27,7 +27,7 @@ public class Main {
new Person("James", 25),
new Person("Kelly", 12)
);
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.naturalOrder()).orElse(null);
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.naturalOrder()).orElse(null);
return minPerson;
}