private static Type extractReturnType(AnnotatedElement element) {
    if (element instanceof Field)  {
      return ((Field) element).getGenericType();
    } else if (element instanceof Method) {
      return ((Method) element).getGenericReturnType();
    } else if (element instanceof Class) {
      return (Class<?>) element;
    }

    throw new IllegalArgumentException(String.format("%s should be %s or %s but was %s", element.getClass().getName(), Field.class.getSimpleName(), Method.class.getSimpleName(), element));
  }
Access to a property or entity (class) possibly via several paths like {@code foo.bar.qux}.

<p>Path always starts with an entity (class) which is root. Each subsequent {@link Member} is appended
as child. So {@code foo.bar.qux} starts with root which is class of {@code foo} then
member {@code foo}, member {@code bar} and member {@code qux}.

<p>This class is immutable
criteria/common/src/org/immutables/criteria/expression/Path.java