private Optional<Class<?>> unwrap(Object pageObject){
  Class<?> wrappedClass=pageObject.getClass();
  while (wrappedClass != null && !wrappedClass.isAnnotationPresent(PageObject.class)) {
    wrappedClass=wrappedClass.getSuperclass();
  }
  return Optional.ofNullable(wrappedClass);
}

private Optional < Class < ? > > unwrap ( Object pageObject ) { Class < ? > wrappedClass = pageObject . getClass ( ) ; while ( wrappedClass != null && ! wrappedClass . isAnnotationPresent ( PageObject . class ) ) { wrappedClass = wrappedClass . getSuperclass ( ) ; } return Optional . ofNullable ( wrappedClass ) ; }
unwraps class wrapped by guice injector .
