Starting with Java 8 so need a bit of time to get used to it. It's a classical problem, I've an array of objects that I want to transform.
Before Java8 the ideal code would be (no null pointers):
P[] outputArray = new P[inputArray.length];
for (int i =0; i< inputArray.length; i++ )
{
outputArray [i] = inputArray[i].transformToP();
}
What is the best version in Java8 ?