Eliminate ArrayList.indexOf usage in SerializationContext on JVM.