EditorConfig documentation test

GitOrigin-RevId: fd52ace3d7a32ecd02c2c5ab90e077967604c15e
This commit is contained in:
Rustam Vishnyakov
2019-06-08 15:31:49 +03:00
committed by intellij-monorepo-bot
parent e6e3eaa09d
commit 123242c4b2
11726 changed files with 314331 additions and 158049 deletions

View File

@@ -0,0 +1,64 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
class MyTest {
public static <T, E, A, R> CompletableFuture<R> mapCollect(Iterator<T> iterator, Function<T, CompletableFuture<E>> body, Collector<E, A, R> collector) {
throw new RuntimeException();
}
public static void main(String[] args) throws Exception {
Collection<Pair<String, Integer>> test = new ArrayList<>();
final CompletableFuture<Map<Object, Object>> future = mapCollect(
test.iterator(),
e -> CompletableFuture.completedFuture(new Pair(e.getKey(), e.getValue())),
Collectors.toMap(
e -> e.getKey(),
e -> e.getValue()
)
);
future.get();
}
public static void main2(String[] args) throws Exception {
Collection<Pair<String, Integer>> test = new ArrayList<>();
final CompletableFuture<Map<Object, Object>> future = mapCollect(
test.iterator(),
e -> CompletableFuture.completedFuture(Pair.of(e.getKey(), e.getValue())),
Collectors.toMap(
e -> e.getKey(),
e -> e.getValue()
)
);
future.get();
}
public static class Pair<K,V> {
private final K key;
private final V value;
public Pair(K key, V value) {
this.key = key;
this.value = value;
}
public K getKey() {
return key;
}
public V getValue() {
return value;
}
public static <A, B> Pair<A, B> of(A a, B b) {
return new Pair<A,B>(a, b);
}
}
}

View File

@@ -0,0 +1,14 @@
import java.util.List;
import java.util.Set;
abstract class Overloadsss {
abstract <T> List<T> foo(List<T> l);
abstract <T> Set<T> foo(Set<T> s);
abstract <K> List<K> bar1(List<K> l);
abstract <K> Set<K> bar1(Set<K> s);
{
List<String> l1 = foo(<caret>bar1(null));
}
}