public Lookup androidLookup(Class<?> declaringClass)
      throws InstantiationException,
          InvocationTargetException,
          NoSuchMethodException,
          IllegalAccessException {
    Lookup lookup;
    try {
      // Android 9+ double reflection
      Class<?> classReference = Class.class;
      Class<?>[] classType = new Class[] {Class.class};
      Method reflectedGetDeclaredConstructor =
          classReference.getDeclaredMethod("getDeclaredConstructor", Class[].class);
      reflectedGetDeclaredConstructor.setAccessible(true);
      Constructor<?> someHiddenMethod =
          (Constructor<?>) reflectedGetDeclaredConstructor.invoke(Lookup.class, (Object) classType);
      lookup = (Lookup) someHiddenMethod.newInstance(declaringClass);
    } catch (IllegalAccessException ex0) {
      // Android < 9 reflection
      Constructor<Lookup> lookupConstructor = Lookup.class.getDeclaredConstructor(Class.class);
      lookupConstructor.setAccessible(true);
      lookup = lookupConstructor.newInstance(declaringClass);
    }
    return (lookup);
  }
Handles default methods by directly invoking the default method code on the interface. The bindTo
method must be called on the result before invoke is called.
core/src/main/java/feign/DefaultMethodHandler.java