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);
        Stack<Integer> stack=new Stack<>();
        stack.add(1);
        stack.add(10);
        stack.add(9);
        stack.add(4);
        stack.add(3);
        stack.add(2);

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

    }

}


