Yes your example is bad. If JIT inlines through, the code is trivially dead and can be removed. So yes, please use proper bench harness (JMH).
edit: https://gist.github.com/anonymous/ed0d8f4a5c6553fe8435
Is there some way in this example it could not actually run the code here?
1) forEach driver method is receiving multiple types, it's not monomorphic 2) you may be hitting OSR compilations 3) for loop may hit range checks on each get() 4) for loop version warms the cache for the stream version and this benchmark is mem ref heavy
So, please try to use JMH to get more accurate picture. And, as mentioned, this isn't really testing for loop vs streams.