title: how to remove the repeated item in arraylist of class
body: <p>I'm trying to data from my server put them in my app,
  using RecyclerView and volley, now because of that I'm using an adapter and this is my adapter class</p>
  
  <pre><code>class TypeAdapter(var con: Context, var list: ArrayList&lt;TypeItems&gt;) : RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;() {
  override fun onBindViewHolder(p0: RecyclerView.ViewHolder, p1: Int) {
  
      (p0 as ItemView).bind(list[p1].cartype, list[p1].typetype, list[p1].modeltype, list[p1].photype)
  
  }
  override fun onCreateViewHolder(p0: ViewGroup, p1: Int): RecyclerView.ViewHolder {
      val v= LayoutInflater.from(con).inflate(R.layout.car_model_item, p0, false)
  
      return ItemView(v)
  }
  
  override fun getItemCount(): Int {
      return list.size
  }
  
  class ItemView(itemVeiw: View) : RecyclerView.ViewHolder(itemVeiw) {
  
      fun bind(car_type: String, type: String, modele: String, ph: String) {
  
          Picasso.with(itemView.context).load(ph).into(itemView.type)
  
          itemView.name.text= "$car_type $type"
          itemView.model.text= modele
  
  
      }
  }
  }
  </code></pre>
  
  <p>and this is my TypeItems class</p>
  
  <pre><code>class TypeItems(car_typetype: String, typetype: String, modeletype: String, phtype: String) {
  var cartype:String = car_typetype
  var typetype:String = typetype
  var modeltype:String = modeletype
  var photype:String = phtype
  
  }
  </code></pre>
  
  <p>and this is my main class</p>
  
  <pre><code>class CarModelActivity : AppCompatActivity() {
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_car_model)
  
      val list= ArrayList&lt;TypeItems&gt;()
  
      val rq= Volley.newRequestQueue(this)
  
      val  url= ("http://test123456789.cf/sell_items/reportall.php?car_type=${car_item.cartype}").replace(" ", "%20")
  
      val srr= StringRequest(Request.Method.GET, url ,
          Response.Listener { response -&gt;
  
              //converting the string to json array object
              val array = JSONArray(response)
  
              list.clear()
  
              //traversing through all the object
              for (i in 0 until array.length()) {
  
                  //getting item object from json array
                  val product = array.getJSONObject(i)
  
  
                  //ex Image
                  var url2= "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRj3LA1ERJCx8lM-qHsgaW_5IgzeW21w-Ona7iI05E9aoXrImtl"
  
                  //adding the product to item list
                  list.add(
                      TypeItems(
                          product.getString("car_type"),
                          product.getString("type"),
                          product.getString("model"),
                          url2
                      )
                  )
  
              }
  
              //creating adapter object and setting it to recyclerview
              val adapter = TypeAdapter(this.applicationContext, list)
              rv.layoutManager= GridLayoutManager(this, 2)
              rv.adapter = adapter
  
          }, Response.ErrorListener { error -&gt;
              Toast.makeText(this, error.message, Toast.LENGTH_LONG).show()
          })
  
      rq.add(srr)
  
  }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QS90T.png" rel="nofollow noreferrer">this is image of the result</a></p>
  
  <p>now I want to remove the repeated items from my list, I want to sort by car_type and type and model, if the item is repeated, I want to remove it</p>