I'm trying to take a list of numbers, filter out the even numbers and then square those even numbers so that the even numbers in the original list are squared. Here's my code:
ArrayList<Long> nums2 = new ArrayList<Long>();
for(long i = 0; i < 100000; i++)
nums2.add(i);
nums2.stream().filter(p -> p%2 == 0).forEach(p -> p = (long)Math.pow(p, 2));
Tried a couple other things, but this is where I'm at so far