public static boolean hasManagedWebdriverField(final Class<?> testClass) { try { return fieldsIn(testClass) .stream() .anyMatch(ManagedWebDriverAnnotatedField::isFieldAnnotated); } catch(NoSuchElementException e) { return false; } }
/** * Find the first field in the class annotated with the <b>Managed</b> annotation. */ static Optional<ManagedWebDriverAnnotatedField> findOptionalAnnotatedField(final Class<?> testClass) { try { return fieldsIn(testClass) .stream() .filter(ManagedWebDriverAnnotatedField::isFieldAnnotated) .map(ManagedWebDriverAnnotatedField::new) .findFirst(); } catch(NoSuchElementException e) { return Optional.empty(); } }
public static boolean hasManagedWebdriverField(final Class<?> testClass) { try { Iterables.find(fieldsIn(testClass), withCorrectAnnotations()); return true; } catch(NoSuchElementException e) { return false; } }
public static boolean hasManagedWebdriverField(final Class<?> testClass) { try { Iterables.find(fieldsIn(testClass), withCorrectAnnotations()); return true; } catch(NoSuchElementException e) { return false; } }
/** * Find the first field in the class annotated with the <b>Managed</b> annotation. */ public static Optional<ManagedWebDriverAnnotatedField> findOptionalAnnotatedField(final Class<?> testClass) { try { Field annotatedField = Iterables.find(fieldsIn(testClass), withCorrectAnnotations()); return Optional.of(new ManagedWebDriverAnnotatedField(annotatedField)); } catch(NoSuchElementException e) { return Optional.absent(); } } /**
/** * Find the first field in the class annotated with the <b>Managed</b> annotation. */ public static Optional<ManagedWebDriverAnnotatedField> findOptionalAnnotatedField(final Class<?> testClass) { try { Field annotatedField = Iterables.find(fieldsIn(testClass), withCorrectAnnotations()); return Optional.of(new ManagedWebDriverAnnotatedField(annotatedField)); } catch(NoSuchElementException e) { return Optional.absent(); } } /**