Reland "Android: Add Error Prone warning against Java stream() apis"

This reverts commit 8ff33dbc1ddcaabcf4da1b92868bfa26ae34ba8f.

Reason for reland: Internal fix landed

Original change's description:
> Revert "Android: Add Error Prone warning against Java stream() apis"
>
> This reverts commit e910d272c026bf1463f54ea17ce6fb16f55513cf.
>
> Reason for revert: crbug.com/344943957#comment13
>
> Original change's description:
> > Android: Add Error Prone warning against Java stream() apis
> >
> > And minor clarifying tweaks to style guide wrt streams
> >
> > Bug: 344943957
> > Change-Id: I90b976866c8f3f71826459b7d3097692e1f533b4
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6042674
> > Auto-Submit: Andrew Grieve <[email protected]>
> > Commit-Queue: Andrew Grieve <[email protected]>
> > Reviewed-by: Henrique Nakashima <[email protected]>
> > Cr-Commit-Position: refs/heads/main@{#1388426}
>
> Bug: 344943957
> Change-Id: Ib9b3d8db9f47383eaced5192a15e7cac6427da35
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6051419
> Reviewed-by: Henrique Nakashima <[email protected]>
> Auto-Submit: Keigo Oka <[email protected]>
> Commit-Queue: Henrique Nakashima <[email protected]>
> Bot-Commit: Rubber Stamper <[email protected]>
> Reviewed-by: Andrew Grieve <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1388467}

Bug: 344943957
Change-Id: I6668c182aa455972684e6863925c498f494fd11f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6055458
Auto-Submit: Andrew Grieve <[email protected]>
Reviewed-by: Henrique Nakashima <[email protected]>
Commit-Queue: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1389041}
diff --git a/styleguide/java/java.md b/styleguide/java/java.md
index 803d878..0de40a01 100644
--- a/styleguide/java/java.md
+++ b/styleguide/java/java.md
@@ -261,16 +261,32 @@
 
 ### Streams
 
-Most uses of [Java streams] are discouraged. If you can write your code as an
-explicit loop, then do so. The primary reason for this guidance is because the
-lambdas (and method references) needed for streams almost always result in
-larger binary size ([example](https://chromium-review.googlesource.com/c/chromium/src/+/4329952).
+Using [Java streams] outside of tests is strongly discouraged. If you can write
+your code as an explicit loop, then do so. The primary reason for this guidance
+is because the lambdas and method references needed for streams almost always
+result in larger binary size than their loop equivalents (see
+[crbug.com/344943957] for examples).
 
 The `parallel()` and `parallelStream()` APIs are simpler than their loop
-equivalents, but are are currently banned due to a lack of a compelling use case
-in Chrome. If you find one, please discuss on `[email protected]`.
+equivalents, but are banned due to a lack of a compelling use case in Chrome.
+If you find one, please discuss on `[email protected]`.
+
+Use of `stream()` without a lambda / method reference is allowed. E.g.:
+
+```java
+@SuppressWarnings("NoStreams")
+private static List<Integer> boxInts(int[] arr) {
+    return Arrays.stream(arr).boxed().collect(Collectors.toList());
+}
+
+@SuppressWarnings("NoStreams")
+private static List<String> readLines(BufferedReader bufferedReader) {
+    return bufferedReader.lines().collect(Collectors.toList());
+}
+```
 
 [Java streams]: https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html
+[crbug.com/344943957]: https://crbug.com/344943957
 
 ### AndroidX Annotations {#annotations}