public void testNewTypeVariable() throws Exception {
TypeVariable<?> noBoundJvmType =
WithTypeVariable.getTypeVariable("withoutBound");
TypeVariable<?> objectBoundJvmType =
WithTypeVariable.getTypeVariable("withObjectBound");
TypeVariable<?> upperBoundJvmType =
WithTypeVariable.getTypeVariable("withUpperBound");
TypeVariable<?> noBound = withBounds(noBoundJvmType);
TypeVariable<?> objectBound = withBounds(objectBoundJvmType, Object.class);
TypeVariable<?> upperBound = withBounds(
upperBoundJvmType, Number.class, CharSequence.class);
assertEqualTypeVariable(noBoundJvmType, noBound);
assertEqualTypeVariable(noBoundJvmType,
withBounds(noBoundJvmType, Object.class));
assertEqualTypeVariable(objectBoundJvmType, objectBound);
assertEqualTypeVariable(upperBoundJvmType, upperBound);
new TypeVariableEqualsTester()
.addEqualityGroup(noBoundJvmType, noBound)
.addEqualityGroup(objectBoundJvmType, objectBound)
.addEqualityGroup(upperBoundJvmType, upperBound)
.testEquals();
}
TypesTest.java 文件源码
java
阅读 42
收藏 0
点赞 0
评论 0
项目:guava-mock
作者:
评论列表
文章目录