@SuppressWarnings("unchecked")
  @Override
  @Nullable
  public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
    if (ID_TYPE_TOKEN.equals(type)) {
      return (TypeAdapter<T>) WRAPPED_ID_ADAPTER;
    }
    if (TIME_INSTANT_TYPE_TOKEN.equals(type)) {
      return (TypeAdapter<T>) WRAPPED_TIME_INSTANT_ADAPTER;
    }
    if (BINARY_TYPE_TOKEN.equals(type)) {
      return (TypeAdapter<T>) WRAPPED_BINARY_ADAPTER;
    }
    if (PATTERN_TYPE_TOKEN.equals(type)) {
      return (TypeAdapter<T>) PATTERN_ADAPTER;
    }
    if (DECIMAL128_TYPE_TOKEN.equals(type)) {
      return (TypeAdapter<T>) DECIMAL128_ADAPTER;
    }
    return null;
  }
Built-in BSON type adapters. Also contains reusable delegate-adapters to easily implement own
wrapper if needed. Supports {@link Id}, {@link TimeInstant}, {@link Binary}, {@link Pattern}
types which correspond to {@code ObjectID}, {@code UTCDate}, {@code Binary}, {@code Regex} native
BSON types, not available in JSON.
<p>
This class also expose simple type adapters to BSON special types, so you can easily write
adapters for your own wrapper types.
@see #binaryAdapter()
@see #objectIdAdapter()
@see #objectIdAdapter()
mongo/src/org/immutables/mongo/types/TypeAdapters.java