TypesTest.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:guava-mock 作者:
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();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号