Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lab_reactive_java
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rtbdp
labs
lab_reactive_java
Commits
5e60fa85
Commit
5e60fa85
authored
8 years ago
by
Stuart Marks
Browse files
Options
Downloads
Patches
Plain Diff
Minor fixes to expanded set of 37 exercises.
parent
57d92013
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LambdaLab/test/exercises/Exercises.java
+7
-3
7 additions, 3 deletions
LambdaLab/test/exercises/Exercises.java
LambdaLab/test/solutions/Exercises.java
+7
-3
7 additions, 3 deletions
LambdaLab/test/solutions/Exercises.java
with
14 additions
and
6 deletions
LambdaLab/test/exercises/Exercises.java
+
7
−
3
View file @
5e60fa85
...
...
@@ -38,6 +38,7 @@ import java.util.Random;
import
java.util.Set
;
import
java.util.TreeMap
;
import
java.util.function.IntConsumer
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
import
java.util.stream.Stream
;
...
...
@@ -926,7 +927,7 @@ public class Exercises {
public
void
ex35_longestCharacterRuns
()
{
String
input
=
"aaaaabbccccdeeeeeeaaafff"
;
in
t
result
=
null
;
// TODO
Str
in
g
result
=
null
;
// TODO
assertEquals
(
"eeeeee"
,
result
);
}
...
...
@@ -942,11 +943,14 @@ public class Exercises {
IntStream
.
range
(
0
,
100
).
mapToObj
(
String:
:
valueOf
).
parallel
();
Collection
<
String
>
result
=
input
.
collect
(
Collector
s
.
of
(
null
,
null
,
null
));
// TODO
input
.
collect
(
Collector
.
of
(
null
,
null
,
null
));
// TODO
assertEquals
(
IntStream
.
range
(
0
,
100
).
map
(
i
->
99
-
i
).
mapToObj
(
String:
:
valueOf
).
collect
(
toList
()),
IntStream
.
range
(
0
,
100
)
.
map
(
i
->
99
-
i
)
.
mapToObj
(
String:
:
valueOf
)
.
collect
(
Collectors
.
toList
()),
new
ArrayList
<>(
result
));
}
...
...
This diff is collapsed.
Click to expand it.
LambdaLab/test/solutions/Exercises.java
+
7
−
3
View file @
5e60fa85
...
...
@@ -38,6 +38,7 @@ import java.util.Random;
import
java.util.Set
;
import
java.util.TreeMap
;
import
java.util.function.IntConsumer
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
import
java.util.stream.Stream
;
...
...
@@ -1238,7 +1239,7 @@ public class Exercises {
public
void
ex35_longestCharacterRuns
()
{
String
input
=
"aaaaabbccccdeeeeeeaaafff"
;
//UNCOMMENT//in
t
result = null; // TODO
//UNCOMMENT//
Str
in
g
result = null; // TODO
//BEGINREMOVE
List
<
Integer
>
bounds
=
...
...
@@ -1272,7 +1273,7 @@ public class Exercises {
IntStream
.
range
(
0
,
100
).
mapToObj
(
String:
:
valueOf
).
parallel
();
//UNCOMMENT//Collection<String> result =
//UNCOMMENT// input.collect(Collector
s
.of(null, null, null)); // TODO
//UNCOMMENT// input.collect(Collector.of(null, null, null)); // TODO
//BEGINREMOVE
...
...
@@ -1284,7 +1285,10 @@ public class Exercises {
//ENDREMOVE
assertEquals
(
IntStream
.
range
(
0
,
100
).
map
(
i
->
99
-
i
).
mapToObj
(
String:
:
valueOf
).
collect
(
toList
()),
IntStream
.
range
(
0
,
100
)
.
map
(
i
->
99
-
i
)
.
mapToObj
(
String:
:
valueOf
)
.
collect
(
Collectors
.
toList
()),
new
ArrayList
<>(
result
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment