mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AppCode:Unit Testing: goto test/class action (OC-2623)
This commit is contained in:
@@ -82,7 +82,7 @@ public class TestFinderHelper {
|
||||
}
|
||||
});
|
||||
|
||||
final List<PsiElement> result = new ArrayList<PsiElement>();
|
||||
final List<PsiElement> result = new ArrayList<PsiElement>(elementsWithWeights.size());
|
||||
for (Pair<? extends PsiNamedElement, Integer> each : elementsWithWeights) {
|
||||
result.add(each.first);
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface NullableFunction<Dom, Img> extends Function<Dom,Img> {
|
||||
public interface NullableFunction<Param, Result> extends Function<Param, Result> {
|
||||
@Nullable
|
||||
Img fun(final Dom dom);
|
||||
Result fun(final Param param);
|
||||
|
||||
/**
|
||||
* @see FunctionUtil#nullConstant()
|
||||
|
||||
@@ -712,6 +712,15 @@ public class ContainerUtil extends ContainerUtilRt {
|
||||
return set;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <KEY, VALUE> Map<KEY, VALUE> map2Map(@NotNull Collection<Pair<KEY, VALUE>> collection) {
|
||||
final Map<KEY, VALUE> result = new THashMap<KEY, VALUE>(collection.size());
|
||||
for (Pair<KEY, VALUE> pair : collection) {
|
||||
result.put(pair.first, pair.second);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <T> Object[] map2Array(@NotNull T[] array, @NotNull Function<T, Object> mapper) {
|
||||
return map2Array(array, Object.class, mapper);
|
||||
|
||||
Reference in New Issue
Block a user