package com.example.myapplication;

import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Stack;

public class MainActivity extends AppCompatActivity {

    @RequiresApi(api = Build.VERSION_CODES.P)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        LinkedList<Integer> list=new LinkedList<>();
        list.add(11);
        list.add(11);
        list.add(11);
        list.add(14);
        list.add(14);
        list.add(20);

        LinkedHashSet<Integer> hashSet=new LinkedHashSet<>(list);
        TextView textView = findViewById(R.id.text);
        textView.setText(hashSet.toString());

    }

}


