private List<TypeAdapter<? extends T>> lookupAdapters() {
    List<TypeAdapter<? extends T>> adapters = new ArrayList<>(subtypes.length);
    for (TypeToken<? extends T> subtype : subtypes) {
      adapters.add(gson.getAdapter(subtype));
    }
    return adapters;
  }
Creates adapter from {@link Gson} and type tokens.
@param <T> the generic type
@param gson Gson instance
@param type supertype token
@param subtypes subtype tokens
@return subtype adapter
gson/src/org/immutables/gson/adapter/ExpectedSubtypesAdapter.java