Support serializing asJavaIterable.