class SqlTimestampTypeAdapter extends TypeAdapter<Timestamp> {
  static final TypeAdapterFactory FACTORY =
      new TypeAdapterFactory() {
        @SuppressWarnings("unchecked") // we use a runtime check to make sure the 'T's equal
        @Override
        public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
          if (typeToken.getRawType() == Timestamp.class) {
            final TypeAdapter<Date> dateTypeAdapter = gson.getAdapter(Date.class);
            return (TypeAdapter<T>) new SqlTimestampTypeAdapter(dateTypeAdapter);
          } else {
            return null;
          }
        }
      };

  private final TypeAdapter<Date> dateTypeAdapter;

  private SqlTimestampTypeAdapter(TypeAdapter<Date> dateTypeAdapter) {
    this.dateTypeAdapter = dateTypeAdapter;
  }

  @Override
  public Timestamp read(JsonReader in) throws IOException {<FILL_FUNCTION_BODY>}

  @Override
  public void write(JsonWriter out, Timestamp value) throws IOException {
    dateTypeAdapter.write(out, value);
  }
}

    Date date = dateTypeAdapter.read(in);
    return date != null ? new Timestamp(date.getTime()) : null;
  
<methods>public void <init>() ,public final java.sql.Timestamp fromJson(java.io.Reader) throws java.io.IOException,public final java.sql.Timestamp fromJson(java.lang.String) throws java.io.IOException,public final java.sql.Timestamp fromJsonTree(com.google.gson.JsonElement) ,public final TypeAdapter<java.sql.Timestamp> nullSafe() ,public abstract java.sql.Timestamp read(com.google.gson.stream.JsonReader) throws java.io.IOException,public final void toJson(java.io.Writer, java.sql.Timestamp) throws java.io.IOException,public final java.lang.String toJson(java.sql.Timestamp) ,public final com.google.gson.JsonElement toJsonTree(java.sql.Timestamp) ,public abstract void write(com.google.gson.stream.JsonWriter, java.sql.Timestamp) throws java.io.IOException<variables>