mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-11 12:35:07 +00:00
Add test_LANG_1698
This commit is contained in:
parent
c455ea2832
commit
6782d1daf8
@ -35,8 +35,10 @@
|
||||
import java.lang.reflect.WildcardType;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -272,6 +274,16 @@ public void test_LANG_1348() throws Exception {
|
||||
assertEquals("T extends java.lang.Enum<T>", TypeUtils.toString(method.getGenericReturnType()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_LANG_1698() {
|
||||
ParameterizedType comparing = (ParameterizedType) Arrays.stream(Comparator.class.getDeclaredMethods())
|
||||
.filter(k -> k.getName().equals("comparing")).findFirst()
|
||||
.orElse(Comparator.class.getDeclaredMethods()[0]).getGenericParameterTypes()[0];
|
||||
final String typeName = TypeUtils
|
||||
.parameterize((Class<?>) comparing.getRawType(), comparing.getActualTypeArguments()).getTypeName();
|
||||
assertEquals("java.util.function.Function<? super T, ? extends U>", typeName);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_LANG_820() {
|
||||
final Type[] typeArray = {String.class, String.class};
|
||||
@ -1048,7 +1060,7 @@ public void testWildcardType() throws Exception {
|
||||
assertEquals(String.format("? extends %s", String.class.getName()), TypeUtils.toString(simpleWildcard));
|
||||
assertEquals(String.format("? extends %s", String.class.getName()), simpleWildcard.toString());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWrap() {
|
||||
final Type t = getClass().getTypeParameters()[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user