Does x=y makes x pointer to y?
<p>I am sorry for such a stupid question, but I cant describe my problem any better. I have 2 classes:</p>

<pre><code>    //First Class
    public class VKtracks extends Fragment {

        RecyclerView list;
        SongListAdapter listAdapter;
        private ArrayList&lt;song&gt; songs = new ArrayList&lt;&gt;();
        MainActivity mainActivity;

        public VKtracks(){

        }

        @Override
        public void onActivityCreated (Bundle savedInstanceState){
            super.onActivityCreated(savedInstanceState);
            mainActivity = (MainActivity)getActivity();
            songs = mainActivity.songs;
            Iterator&lt;song&gt; itr = songs.iterator();
            while (itr.hasNext()) {
                song element = itr.next();
                if(element.getSource() == 0){
                    itr.remove();
                }
            }
        }

    //Second class

public class Tracks extends Fragment {


    RecyclerView list;
    private MediaPlayer mp = new MediaPlayer();
    SongListAdapter listAdapter;
    private ArrayList&lt;song&gt; songs = new ArrayList&lt;&gt;();
    ImageButton playButton;
    boolean playerActive = false;
    MainActivity mainActivity;
    int mLastFirstVisibleItem = 0;


    public Tracks() {
    }

    @Override
    public void onActivityCreated (Bundle savedInstanceState){
        super.onActivityCreated(savedInstanceState);
        mainActivity = (MainActivity)getActivity();
        songs = mainActivity.songs;
        listAdapter = new SongListAdapter(getContext(),songs, mainActivity);
        listAdapter.notifyDataSetChanged();
        list.setHasFixedSize(true);
        LinearLayoutManager llm = new LinearLayoutManager(getActivity());
        list.setLayoutManager(llm);
        list.setAdapter(listAdapter);
    }
}
</code></pre>

<p>In both classes I am getting a list of songs from MainActivity. In the Tracks class I am just filling the RecyclerView with it, and in the VKtracks I am deliting unnecessary items with iterator and filling another RecyclerView. At the end i have 2 similar filtred lists. If I comment filtering part in the VKTracks class I am getting 2 similar unfiltred lists. </p>

<p>So, why this happens?</p>

<p>The only reasong I can suppose is that both songs ArrayLists are poiners to a songs ArrayList in the MainActivity.</p>