How to move zero’s to end in an array List of integers using streams

This is the third solution to move all Zero numbers to the end of an arrayList. This solution uses filter(), map() methods of stream. The resultant arrayList has all the exists zero’s moved to end.

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class MovingZerosToEndOfArrayList {

	public static void main(String[] args) {

		// Initialize Array list of integers, include non zeroes and zeros
		ArrayList<Integer> intList = new ArrayList<>(Arrays.asList(34, 0, 45, 0, 62, 0, 13, 49));
		System.out.println("The given Arraylist: ");
		System.out.println(intList);

		// Count the number of Zeros using filter() method of stream
		long zerosCnt = intList.stream().filter(e -> e == 0).count();

		// Traverse through stream to form a list of non zereos, using filter and map.
		List<Integer> intListFinal = intList.stream().filter(e -> e != 0).map(x -> x).collect(Collectors.toList());
		for (; zerosCnt > 0; zerosCnt--)
			intListFinal.add(0);

		System.out.println("\nThe Final Arraylist after moving 0's to end: ");
		System.out.println(intListFinal);
	}
}
Output:
The given Arraylist: 
[34, 0, 45, 0, 62, 0, 13, 49]

The Final Arraylist after moving 0's to end: 
[34, 45, 62, 13, 49, 0, 0, 0]