23
23
import java .util .List ;
24
24
import java .util .Map ;
25
25
import java .util .Random ;
26
+ import java .util .stream .Collectors ;
27
+ import java .util .stream .IntStream ;
26
28
import software .amazon .awssdk .core .SdkBytes ;
27
29
28
30
abstract class ItemFactory <T > {
@@ -65,40 +67,7 @@ public final HugeBean hugeBean() {
65
67
b .setHashKey (randomS ());
66
68
b .setStringAttr (randomS ());
67
69
b .setBinaryAttr (randomBytes ());
68
- b .setListAttr (Arrays .asList (randomS (),
69
- randomS (),
70
- randomS (),
71
-
72
- randomS (),
73
- randomS (),
74
- randomS (),
75
- randomS (),
76
-
77
- randomS (),
78
- randomS (),
79
- randomS (),
80
- randomS (),
81
- randomS (),
82
- randomS (),
83
- randomS (),
84
- randomS (),
85
-
86
- randomS (),
87
- randomS (),
88
- randomS (),
89
- randomS (),
90
- randomS (),
91
- randomS (),
92
- randomS (),
93
- randomS (),
94
- randomS (),
95
- randomS (),
96
- randomS (),
97
- randomS (),
98
- randomS (),
99
- randomS (),
100
- randomS (),
101
- randomS ()));
70
+ b .setListAttr (IntStream .range (0 , 32 ).mapToObj (i -> randomS ()).collect (Collectors .toList ()));
102
71
103
72
Map <String , SdkBytes > mapAttr1 = new HashMap <>();
104
73
mapAttr1 .put ("key1" , randomBytes ());
@@ -109,40 +78,10 @@ public final HugeBean hugeBean() {
109
78
110
79
Map <String , List <SdkBytes >> mapAttr2 = new HashMap <>();
111
80
mapAttr2 .put ("key1" , Arrays .asList (randomBytes ()));
112
- mapAttr2 .put ("key2" , Arrays .asList (
113
- randomBytes (),
114
- randomBytes ()));
115
- mapAttr2 .put ("key3" , Arrays .asList (
116
- randomBytes (),
117
- randomBytes (),
118
- randomBytes (),
119
- randomBytes ()));
120
- mapAttr2 .put ("key4" , Arrays .asList (
121
- randomBytes (),
122
- randomBytes (),
123
- randomBytes (),
124
- randomBytes (),
125
- randomBytes (),
126
- randomBytes (),
127
- randomBytes (),
128
- randomBytes ()));
129
- mapAttr2 .put ("key5" , Arrays .asList (
130
- randomBytes (),
131
- randomBytes (),
132
- randomBytes (),
133
- randomBytes (),
134
- randomBytes (),
135
- randomBytes (),
136
- randomBytes (),
137
- randomBytes (),
138
- randomBytes (),
139
- randomBytes (),
140
- randomBytes (),
141
- randomBytes (),
142
- randomBytes (),
143
- randomBytes (),
144
- randomBytes (),
145
- randomBytes ()));
81
+ mapAttr2 .put ("key2" , IntStream .range (0 , 2 ).mapToObj (i -> randomBytes ()).collect (Collectors .toList ()));
82
+ mapAttr2 .put ("key3" , IntStream .range (0 , 4 ).mapToObj (i -> randomBytes ()).collect (Collectors .toList ()));
83
+ mapAttr2 .put ("key4" , IntStream .range (0 , 8 ).mapToObj (i -> randomBytes ()).collect (Collectors .toList ()));
84
+ mapAttr2 .put ("key5" , IntStream .range (0 , 16 ).mapToObj (i -> randomBytes ()).collect (Collectors .toList ()));
146
85
147
86
b .setMapAttr2 (mapAttr2 );
148
87
@@ -151,14 +90,13 @@ public final HugeBean hugeBean() {
151
90
152
91
List <Map <String , List <SdkBytes >>> value = Arrays .asList (
153
92
ImmutableMapParameter .<String , List <SdkBytes >>builder ()
154
- .put ("key1" , Arrays . asList ( randomBytes (), randomBytes ()))
93
+ .put ("key1" , IntStream . range ( 0 , 2 ). mapToObj ( i -> randomBytes ()). collect ( Collectors . toList ()))
155
94
.build (),
156
95
ImmutableMapParameter .<String , List <SdkBytes >>builder ()
157
- .put ("key2" , Arrays . asList ( randomBytes (), randomBytes (), randomBytes (), randomBytes ()))
96
+ .put ("key2" , IntStream . range ( 0 , 4 ). mapToObj ( i -> randomBytes ()). collect ( Collectors . toList ()))
158
97
.build (),
159
98
ImmutableMapParameter .<String , List <SdkBytes >>builder ()
160
- .put ("key3" , Arrays .asList (randomBytes (), randomBytes (), randomBytes (), randomBytes (),
161
- randomBytes (), randomBytes (), randomBytes (), randomBytes ()))
99
+ .put ("key3" , IntStream .range (0 , 8 ).mapToObj (i -> randomBytes ()).collect (Collectors .toList ()))
162
100
.build ()
163
101
);
164
102
0 commit comments