How to use firstBound method of org.mockito.internal.util.reflection.GenericMetadataSupport class

Best Mockito code snippet using org.mockito.internal.util.reflection.GenericMetadataSupport.firstBound

Source:GenericMetadataSupport.java Github

copy

Full Screen

...116 * - Multiple bounds are not supported (for instance, this is not allowed: <? extends List<String> & MyInterface>)117 */118119 WildCardBoundedType wildCardBoundedType = new WildCardBoundedType(wildCard);120 if (wildCardBoundedType.firstBound() instanceof TypeVariable) {121 return boundsOf((TypeVariable) wildCardBoundedType.firstBound());122 }123124 return wildCardBoundedType;125 }126127128129 /**130 * @return Raw type of the current instance.131 */132 public abstract Class<?> rawType();133134135136 /**137 * @return Returns extra interfaces <strong>if relevant</strong>, otherwise empty List.138 */139 public List<Type> extraInterfaces() {140 return Collections.emptyList();141 }142143 /**144 * @return Returns an array with the raw types of {@link #extraInterfaces()} <strong>if relevant</strong>.145 */146 public Class<?>[] rawExtraInterfaces() {147 return new Class[0];148 }149150151152 /**153 * @return Actual type arguments matching the type variables of the raw type represented by this {@link GenericMetadataSupport} instance.154 */155 public Map<TypeVariable, Type> actualTypeArguments() {156 TypeVariable[] typeParameters = rawType().getTypeParameters();157 LinkedHashMap<TypeVariable, Type> actualTypeArguments = new LinkedHashMap<TypeVariable, Type>();158159 for (TypeVariable typeParameter : typeParameters) {160161 Type actualType = getActualTypeArgumentFor(typeParameter);162163 actualTypeArguments.put(typeParameter, actualType);164 // logger.log("For '" + rawType().getCanonicalName() + "' returning explicit TypeVariable : { '" + typeParameter + "(" + System.identityHashCode(typeParameter) + ")" + "' : '" + actualType +"' }");165 }166167 return actualTypeArguments;168 }169170 protected Type getActualTypeArgumentFor(TypeVariable typeParameter) {171 Type type = this.contextualActualTypeParameters.get(typeParameter);172 if (type instanceof TypeVariable) {173 TypeVariable typeVariable = (TypeVariable) type;174 return getActualTypeArgumentFor(typeVariable);175 }176177 return type;178 }179180181182 /**183 * Resolve current method generic return type to a {@link GenericMetadataSupport}.184 *185 * @param method Method to resolve the return type.186 * @return {@link GenericMetadataSupport} representing this generic return type.187 */188 public GenericMetadataSupport resolveGenericReturnType(Method method) {189 Type genericReturnType = method.getGenericReturnType();190 // logger.log("Method '" + method.toGenericString() + "' has return type : " + genericReturnType.getClass().getInterfaces()[0].getSimpleName() + " : " + genericReturnType);191192 if (genericReturnType instanceof Class) {193 return new NotGenericReturnTypeSupport(genericReturnType);194 }195 if (genericReturnType instanceof ParameterizedType) {196 return new ParameterizedReturnType(this, method.getTypeParameters(), (ParameterizedType) method.getGenericReturnType());197 }198 if (genericReturnType instanceof TypeVariable) {199 return new TypeVariableReturnType(this, method.getTypeParameters(), (TypeVariable) genericReturnType);200 }201202 throw new MockitoException("Ouch, it shouldn't happen, type '" + genericReturnType.getClass().getCanonicalName() + "' on method : '" + method.toGenericString() + "' is not supported : " + genericReturnType);203 }204205 /**206 * Create an new instance of {@link GenericMetadataSupport} inferred from a {@link Type}.207 *208 * <p>209 * At the moment <code>type</code> can only be a {@link Class} or a {@link ParameterizedType}, otherwise210 * it'll throw a {@link MockitoException}.211 * </p>212 *213 * @param type The class from which the {@link GenericMetadataSupport} should be built.214 * @return The new {@link GenericMetadataSupport}.215 * @throws MockitoException Raised if type is not a {@link Class} or a {@link ParameterizedType}.216 */217 public static GenericMetadataSupport inferFrom(Type type) {218 Checks.checkNotNull(type, "type");219 if (type instanceof Class) {220 return new FromClassGenericMetadataSupport((Class<?>) type);221 }222 if (type instanceof ParameterizedType) {223 return new FromParameterizedTypeGenericMetadataSupport((ParameterizedType) type);224 }225226 throw new MockitoException("Type meta-data for this Type (" + type.getClass().getCanonicalName() + ") is not supported : " + type);227 }228229230 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////231 //// Below are specializations of GenericMetadataSupport that could handle retrieval of possible Types232 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////233234 /**235 * Generic metadata implementation for {@link Class}.236 *237 * Offer support to retrieve generic metadata on a {@link Class} by reading type parameters and type variables on238 * the class and its ancestors and interfaces.239 */240 private static class FromClassGenericMetadataSupport extends GenericMetadataSupport {241 private Class<?> clazz;242243 public FromClassGenericMetadataSupport(Class<?> clazz) {244 this.clazz = clazz;245 readActualTypeParametersOnDeclaringClass();246 }247248 private void readActualTypeParametersOnDeclaringClass() {249 registerTypeParametersOn(clazz.getTypeParameters());250 registerTypeVariablesOn(clazz.getGenericSuperclass());251 for (Type genericInterface : clazz.getGenericInterfaces()) {252 registerTypeVariablesOn(genericInterface);253 }254 }255256 @Override257 public Class<?> rawType() {258 return clazz;259 }260 }261262263 /**264 * Generic metadata implementation for "standalone" {@link ParameterizedType}.265 *266 * Offer support to retrieve generic metadata on a {@link ParameterizedType} by reading type variables of267 * the related raw type and declared type variable of this parameterized type.268 *269 * This class is not designed to work on ParameterizedType returned by {@link Method#getGenericReturnType()}, as270 * the ParameterizedType instance return in these cases could have Type Variables that refer to type declaration(s).271 * That's what meant the "standalone" word at the beginning of the Javadoc.272 * Instead use {@link ParameterizedReturnType}.273 */274 private static class FromParameterizedTypeGenericMetadataSupport extends GenericMetadataSupport {275 private ParameterizedType parameterizedType;276277 public FromParameterizedTypeGenericMetadataSupport(ParameterizedType parameterizedType) {278 this.parameterizedType = parameterizedType;279 readActualTypeParameters();280 }281282 private void readActualTypeParameters() {283 registerTypeVariablesOn(parameterizedType.getRawType());284 registerTypeVariablesOn(parameterizedType);285 }286287 @Override288 public Class<?> rawType() {289 return (Class<?>) parameterizedType.getRawType();290 }291 }292293294 /**295 * Generic metadata specific to {@link ParameterizedType} returned via {@link Method#getGenericReturnType()}.296 */297 private static class ParameterizedReturnType extends GenericMetadataSupport {298 private final ParameterizedType parameterizedType;299 private final TypeVariable[] typeParameters;300301 public ParameterizedReturnType(GenericMetadataSupport source, TypeVariable[] typeParameters, ParameterizedType parameterizedType) {302 this.parameterizedType = parameterizedType;303 this.typeParameters = typeParameters;304 this.contextualActualTypeParameters = source.contextualActualTypeParameters;305306 readTypeParameters();307 readTypeVariables();308 }309310 private void readTypeParameters() {311 registerTypeParametersOn(typeParameters);312 }313314 private void readTypeVariables() {315 registerTypeVariablesOn(parameterizedType);316 }317318 @Override319 public Class<?> rawType() {320 return (Class<?>) parameterizedType.getRawType();321 }322323 }324325326 /**327 * Generic metadata for {@link TypeVariable} returned via {@link Method#getGenericReturnType()}.328 */329 private static class TypeVariableReturnType extends GenericMetadataSupport {330 private final TypeVariable typeVariable;331 private final TypeVariable[] typeParameters;332 private Class<?> rawType;333334335336 public TypeVariableReturnType(GenericMetadataSupport source, TypeVariable[] typeParameters, TypeVariable typeVariable) {337 this.typeParameters = typeParameters;338 this.typeVariable = typeVariable;339 this.contextualActualTypeParameters = source.contextualActualTypeParameters;340341 readTypeParameters();342 readTypeVariables();343 }344345 private void readTypeParameters() {346 registerTypeParametersOn(typeParameters);347 }348349 private void readTypeVariables() {350 for (Type type : typeVariable.getBounds()) {351 registerTypeVariablesOn(type);352 }353 registerTypeVariablesOn(getActualTypeArgumentFor(typeVariable));354 }355356 @Override357 public Class<?> rawType() {358 if (rawType == null) {359 rawType = extractRawTypeOf(typeVariable);360 }361 return rawType;362 }363364 private Class<?> extractRawTypeOf(Type type) {365 if (type instanceof Class) {366 return (Class<?>) type;367 }368 if (type instanceof ParameterizedType) {369 return (Class<?>) ((ParameterizedType) type).getRawType();370 }371 if (type instanceof BoundedType) {372 return extractRawTypeOf(((BoundedType) type).firstBound());373 }374 if (type instanceof TypeVariable) {375 /*376 * If type is a TypeVariable, then it is needed to gather data elsewhere. Usually TypeVariables are declared377 * on the class definition, such as such as List<E>.378 */379 return extractRawTypeOf(contextualActualTypeParameters.get(type));380 }381 throw new MockitoException("Raw extraction not supported for : '" + type + "'");382 }383384 @Override385 public List<Type> extraInterfaces() {386 Type type = extractActualBoundedTypeOf(typeVariable);387 if (type instanceof BoundedType) {388 return Arrays.asList(((BoundedType) type).interfaceBounds());389 }390 if (type instanceof ParameterizedType) {391 return Collections.singletonList(type);392 }393 if (type instanceof Class) {394 return Collections.emptyList();395 }396 throw new MockitoException("Cannot extract extra-interfaces from '" + typeVariable + "' : '" + type + "'");397 }398399 /**400 * @return Returns an array with the extracted raw types of {@link #extraInterfaces()}.401 * @see #extractRawTypeOf(java.lang.reflect.Type)402 */403 public Class<?>[] rawExtraInterfaces() {404 List<Type> extraInterfaces = extraInterfaces();405 List<Class<?>> rawExtraInterfaces = new ArrayList<Class<?>>();406 for (Type extraInterface : extraInterfaces) {407 Class<?> rawInterface = extractRawTypeOf(extraInterface);408 // avoid interface collision with actual raw type (with typevariables, resolution ca be quite aggressive)409 if(!rawType().equals(rawInterface)) {410 rawExtraInterfaces.add(rawInterface);411 }412 }413 return rawExtraInterfaces.toArray(new Class[rawExtraInterfaces.size()]);414 }415416 private Type extractActualBoundedTypeOf(Type type) {417 if (type instanceof TypeVariable) {418 /*419 If type is a TypeVariable, then it is needed to gather data elsewhere. Usually TypeVariables are declared420 on the class definition, such as such as List<E>.421 */422 return extractActualBoundedTypeOf(contextualActualTypeParameters.get(type));423 }424 if (type instanceof BoundedType) {425 Type actualFirstBound = extractActualBoundedTypeOf(((BoundedType) type).firstBound());426 if (!(actualFirstBound instanceof BoundedType)) {427 return type; // avoid going one step further, ie avoid : O(TypeVar) -> K(TypeVar) -> Some ParamType428 }429 return actualFirstBound;430 }431 return type; // irrelevant, we don't manage other types as they are not bounded.432 }433 }434435436437 /**438 * Non-Generic metadata for {@link Class} returned via {@link Method#getGenericReturnType()}.439 */440 private static class NotGenericReturnTypeSupport extends GenericMetadataSupport {441 private final Class<?> returnType;442443 public NotGenericReturnTypeSupport(Type genericReturnType) {444 returnType = (Class<?>) genericReturnType;445 }446447 @Override448 public Class<?> rawType() {449 return returnType;450 }451 }452453454455 /**456 * Type representing bounds of a type457 *458 * @see TypeVarBoundedType459 * @see <a href="http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4">http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4</a>460 * @see WildCardBoundedType461 * @see <a href="http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.5.1">http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.5.1</a>462 */463 public static interface BoundedType extends Type {464 Type firstBound();465466 Type[] interfaceBounds();467 }468469 /**470 * Type representing bounds of a type variable, allows to keep all bounds information.471 *472 * <p>It uses the first bound in the array, as this array is never null and always contains at least473 * one element (Object is always here if no bounds are declared).</p>474 *475 * <p>If upper bounds are declared with SomeClass and additional interfaces, then firstBound will be SomeClass and476 * interfacesBound will be an array of the additional interfaces.477 *478 * i.e. <code>SomeClass</code>.479 * <pre class="code"><code class="java">480 * interface UpperBoundedTypeWithClass<E extends Comparable<E> & Cloneable> {481 * E get();482 * }483 * // will return Comparable type484 * </code></pre>485 * </p>486 *487 * @see <a href="http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4">http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4</a>488 */489 public static class TypeVarBoundedType implements BoundedType {490 private TypeVariable typeVariable;491492493 public TypeVarBoundedType(TypeVariable typeVariable) {494 this.typeVariable = typeVariable;495 }496497 /**498 * @return either a class or an interface (parameterized or not), if no bounds declared Object is returned.499 */500 public Type firstBound() {501 return typeVariable.getBounds()[0]; //502 }503504 /**505 * On a Type Variable (typeVar extends C_0 & I_1 & I_2 & etc), will return an array506 * containing I_1 and I_2.507 *508 * @return other bounds for this type, these bounds can only be only interfaces as the JLS says,509 * empty array if no other bound declared.510 */511 public Type[] interfaceBounds() {512 Type[] interfaceBounds = new Type[typeVariable.getBounds().length - 1];513 System.arraycopy(typeVariable.getBounds(), 1, interfaceBounds, 0, typeVariable.getBounds().length - 1);514 return interfaceBounds;515 }516517 @Override518 public boolean equals(Object o) {519 if (this == o) return true;520 if (o == null || getClass() != o.getClass()) return false;521522 return typeVariable.equals(((TypeVarBoundedType) o).typeVariable);523524 }525526 @Override527 public int hashCode() {528 return typeVariable.hashCode();529 }530531 @Override532 public String toString() {533 final StringBuilder sb = new StringBuilder();534 sb.append("{firstBound=").append(firstBound());535 sb.append(", interfaceBounds=").append(Arrays.deepToString(interfaceBounds()));536 sb.append('}');537 return sb.toString();538 }539540 public TypeVariable typeVariable() {541 return typeVariable;542 }543 }544545 /**546 * Type representing bounds of a wildcard, allows to keep all bounds information.547 *548 * <p>The JLS says that lower bound and upper bound are mutually exclusive, and that multiple bounds549 * are not allowed.550 *551 * @see <a href="http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4">http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4</a>552 */553 public static class WildCardBoundedType implements BoundedType {554 private WildcardType wildcard;555556557 public WildCardBoundedType(WildcardType wildcard) {558 this.wildcard = wildcard;559 }560561 /**562 * @return The first bound, either a type or a reference to a TypeVariable563 */564 public Type firstBound() {565 Type[] lowerBounds = wildcard.getLowerBounds();566 Type[] upperBounds = wildcard.getUpperBounds();567568 return lowerBounds.length != 0 ? lowerBounds[0] : upperBounds[0];569 }570571 /**572 * @return An empty array as, wildcard don't support multiple bounds.573 */574 public Type[] interfaceBounds() {575 return new Type[0];576 }577578 @Override579 public boolean equals(Object o) {580 if (this == o) return true;581 if (o == null || getClass() != o.getClass()) return false;582583 return wildcard.equals(((TypeVarBoundedType) o).typeVariable);584585 }586587 @Override588 public int hashCode() {589 return wildcard.hashCode();590 }591592 @Override593 public String toString() {594 final StringBuilder sb = new StringBuilder();595 sb.append("{firstBound=").append(firstBound());596 sb.append(", interfaceBounds=[]}");597 return sb.toString();598 }599600 public WildcardType wildCard() {601 return wildcard;602 }603 }604605}606607 ...

Full Screen

Full Screen

firstBound

Using AI Code Generation

copy

Full Screen

1import java.lang.reflect.Method;2import java.util.Arrays;3import org.mockito.internal.util.reflection.GenericMetadataSupport;4public class GenericMetadataSupportTest {5 public static void main(String[] args) throws Exception {6 Method method = GenericMetadataSupportTest.class.getMethod("method", String.class);7 GenericMetadataSupport genericMetadataSupport = new GenericMetadataSupport(method);8 System.out.println("First bound: " + genericMetadataSupport.firstBound());9 }10 public <T> void method(T t) {11 }12}

Full Screen

Full Screen

firstBound

Using AI Code Generation

copy

Full Screen

1import org.mockito.internal.util.reflection.GenericMetadataSupport2import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType3def genericMetadataSupport = new GenericMetadataSupport()4def genericType = genericMetadataSupport.firstBound(new GenericType(List.class))5import org.mockito.internal.util.reflection.GenericMetadataSupport6import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType7def genericMetadataSupport = new GenericMetadataSupport()8def genericType = genericMetadataSupport.firstBound(new GenericType(List.class))9import org.mockito.internal.util.reflection.GenericMetadataSupport10import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType11def genericMetadataSupport = new GenericMetadataSupport()12def genericType = genericMetadataSupport.firstBound(new GenericType(List.class))13import org.mockito.internal.util.reflection.GenericMetadataSupport14import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType15def genericMetadataSupport = new GenericMetadataSupport()16def genericType = genericMetadataSupport.firstBound(new GenericType(List.class))17import org.mockito.internal.util.reflection.GenericMetadataSupport18import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType19def genericMetadataSupport = new GenericMetadataSupport()20def genericType = genericMetadataSupport.firstBound(new GenericType(List.class))21import org.mockito.internal.util.reflection.GenericMetadataSupport22import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType23def genericMetadataSupport = new GenericMetadataSupport()24def genericType = genericMetadataSupport.firstBound(new GenericType(List.class))25import org.mockito.internal.util.reflection.GenericMetadataSupport26import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType27def genericMetadataSupport = new GenericMetadataSupport()

Full Screen

Full Screen

firstBound

Using AI Code Generation

copy

Full Screen

1import org.mockito.internal.util.reflection.GenericMetadataSupport2import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType3class GenericMetadataSupportTest {4 def "test firstBound"() {5 def genericMetadataSupport = new GenericMetadataSupport()6 def result = genericMetadataSupport.firstBound(GenericType.of(MyType.class))7 }8 static class MyType<T extends String> {9 }10}

Full Screen

Full Screen

firstBound

Using AI Code Generation

copy

Full Screen

1 private static final String[] GENERIC_METADATA_SUPPORT_FIRST_BOUND = {2 "package org.mockito.internal.util.reflection;",3 "import java.lang.reflect.TypeVariable;",4 "import java.util.Arrays;",5 "import java.util.HashMap;",6 "import java.util.Map;",7 "import java.util.Set;",8 "public class GenericMetadataSupport {",9 " private final Class<?> rawType;",10 " private final TypeVariable<?>[] typeParameters;",11 " private final Map<TypeVariable<?>, Type> typeArguments;",12 " public GenericMetadataSupport(Class<?> rawType, TypeVariable<?>[] typeParameters, Map<TypeVariable<?>, Type> typeArguments) {",13 " this.rawType = rawType;",14 " this.typeParameters = typeParameters;",15 " this.typeArguments = typeArguments;",16 " }",17 " public static GenericMetadataSupport of(Class<?> rawType, TypeVariable<?>[] typeParameters, Map<TypeVariable<?>, Type> typeArguments) {",18 " return new GenericMetadataSupport(rawType, typeParameters, typeArguments);",19 " }",20 " public static GenericMetadataSupport of(Class<?> rawType, TypeVariable<?>[] typeParameters, Type[] actualTypeArguments) {",21 " Map<TypeVariable<?>, Type> typeArguments = new HashMap<TypeVariable<?>, Type>();",22 " for (int i = 0; i < typeParameters.length; i++) {",23 " typeArguments.put(typeParameters[i], actualTypeArguments[i]);",24 " }",25 " return new GenericMetadataSupport(rawType, typeParameters, typeArguments);",26 " }",27 " public static GenericMetadataSupport of(Class<?> rawType, TypeVariable<?>[] typeParameters, Type[] actualTypeArguments, Type ownerType) {",28 " Map<TypeVariable<?>, Type> typeArguments = new HashMap<TypeVariable<?>, Type>();",29 " for (int i = 0; i < typeParameters.length; i++) {",30 " typeArguments.put(typeParameters[i], actualTypeArguments[i]);",31 " }",32 " if (ownerType != null && ownerType instanceof ParameterizedType) {",33 " ParameterizedType parameterizedOwnerType = (ParameterizedType) ownerType;",

Full Screen

Full Screen

firstBound

Using AI Code Generation

copy

Full Screen

1import org.mockito.internal.util.reflection.GenericMetadataSupport2import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType3def genericType = GenericMetadataSupport.firstBound(GenericType.of(Iterable.class))4import org.mockito.internal.util.reflection.ParameterizedTypeImpl5def parameterizedType = new ParameterizedTypeImpl(Iterable.class, [String.class])6def genericType = GenericMetadataSupport.firstBound(parameterizedType)7import org.mockito.internal.util.reflection.GenericMetadataSupport8import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType9def genericType = GenericMetadataSupport.firstBound(GenericType.of(Iterable.class))10import org.mockito.internal.util.reflection.ParameterizedTypeImpl11def parameterizedType = new ParameterizedTypeImpl(Iterable.class, [String.class])12def genericType = GenericMetadataSupport.firstBound(parameterizedType)13import org.mockito.internal.util.reflection.GenericMetadataSupport14import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType15def genericType = GenericMetadataSupport.firstBound(GenericType.of(Iterable.class))16import org.mockito.internal.util.reflection.ParameterizedTypeImpl17def parameterizedType = new ParameterizedTypeImpl(Iterable.class, [String.class])18def genericType = GenericMetadataSupport.firstBound(parameterizedType)19import org.mockito.internal.util.reflection.GenericMetadataSupport20import org.mockito.internal.util.reflection.GenericMetadataSupport.GenericType21def genericType = GenericMetadataSupport.firstBound(GenericType.of(Iterable.class))

Full Screen

Full Screen

firstBound

Using AI Code Generation

copy

Full Screen

1List<String> mock = mock(List.class);2Type firstBound = GenericMetadataSupport.firstBound(mock.getClass());3System.out.println(firstBound);4List mock2 = mock(List.class);5Type firstBound2 = GenericMetadataSupport.firstBound(mock2.getClass());6System.out.println(firstBound2);7List mock3 = mock(List.class);8Type firstBound3 = GenericMetadataSupport.firstBound(mock3.getClass());9System.out.println(firstBound3);10List mock4 = mock(List.class);11Type firstBound4 = GenericMetadataSupport.firstBound(mock4.getClass());12System.out.println(firstBound4);13List mock5 = mock(List.class);14Type firstBound5 = GenericMetadataSupport.firstBound(mock5.getClass());15System.out.println(firstBound5);16List mock6 = mock(List.class);17Type firstBound6 = GenericMetadataSupport.firstBound(mock6.getClass());18System.out.println(firstBound6);19List mock7 = mock(List.class);20Type firstBound7 = GenericMetadataSupport.firstBound(mock7.getClass());21System.out.println(firstBound7);22List mock8 = mock(List.class);23Type firstBound8 = GenericMetadataSupport.firstBound(mock8.getClass());24System.out.println(firstBound8);

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful