Gson doesnt have direct support for serializing @AutoValue classes or for Optional<> fields, but com.ryanharter.auto.value adds @AutoValue and net.dongliu:gson-java8-d