package com.igumnov.common;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Stream;

public class Strings {

    public static Stream<Character> stream(String s) {
        int len = s.length();
        Character[] chars = new Character[len];
        for (int i = 0; i < len ; i++) {
            chars[i] = new Character(s.charAt(i));
        }
        ArrayList<Character> line = new ArrayList<Character>(Arrays.asList(chars));
        return line.stream();
    }
}

@@ -26,61 +26,8 @@
 n;%0A%0A
-import java.util.ArrayList;%0Aimport java.util.Arrays;%0A
 impo
@@ -146,76 +146,60 @@
     
-int len = s.length();%0A        Character%5B%5D chars = new Character%5Blen%5D
+Stream.Builder%3CCharacter%3E builder = Stream.builder()
 ;%0A  
@@ -207,17 +207,16 @@
      for
- 
 (int i =
@@ -217,16 +217,37 @@
 nt i = 0
+, length = s.length()
 ; i %3C le
@@ -251,16 +251,17 @@
  len
- 
+gth
 ; i++)
- 
 %7B%0A  
@@ -274,32 +274,19 @@
     
-chars%5Bi%5D = new Character
+builder.add
 (s.c
@@ -318,110 +318,28 @@
     
-ArrayList%3CCharacter%3E line = new ArrayList%3CCharacter%3E(Arrays.asList(chars));%0A        return line.stream
+return builder.build
 ();%0A

Update Strings