mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
testdata for IDEA-154861
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import java.util.Set;
|
||||
|
||||
class Test
|
||||
{
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void someMethod(final Set<String> set)
|
||||
{
|
||||
when(set)
|
||||
.thenAnswer(invocationOnMock -> union(set, (Set<String>) invocationOnMock.getArguments()[0]));
|
||||
}
|
||||
|
||||
|
||||
static <T> OngoingStubbing<T> when(T methodCall)
|
||||
{
|
||||
return answer -> null;
|
||||
}
|
||||
|
||||
interface OngoingStubbing<T>
|
||||
{
|
||||
OngoingStubbing<T> thenAnswer(Answer<?> answer);
|
||||
}
|
||||
|
||||
interface Answer<T> {
|
||||
T answer(InvocationOnMock invocation) throws Throwable;
|
||||
}
|
||||
|
||||
interface InvocationOnMock
|
||||
{
|
||||
Object[] getArguments();
|
||||
}
|
||||
|
||||
static <E> Set<E> union(final Set<? extends E> set1, final Set<? extends E> set2) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user