Skip to content

Commit 06af17f

Browse files
committed
Remove public in the Consumer.java
1 parent 19efa5a commit 06af17f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/test/java/com/github/streams/learn/functional_interfaces/C_ConsumerTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ class C_ConsumerTest {
1313
/** Write a lambda expression that appends the string "abc" to the given StringBuilder. */
1414
@Test
1515
@Disabled
16-
public void c_consumer1() {
17-
Consumer<StringBuilder> cons = null; // TODO
18-
16+
void c_consumer1() {
1917
StringBuilder sb = new StringBuilder("xyz");
20-
cons.accept(sb);
18+
Consumer<StringBuilder> appenderConsumer = null; // TODO
19+
20+
appenderConsumer.accept(sb);
21+
2122
assertEquals("xyzabc", sb.toString());
2223
}
2324

2425
/** Write a lambda expression that clears the given list. */
2526
@Test
2627
@Disabled
27-
public void c_consumer2() {
28+
void c_consumer2() {
2829
Consumer<List<String>> cons = null; // TODO
2930

3031
List<String> list = new ArrayList<>(List.of("a", "b", "c"));
@@ -35,7 +36,7 @@ public void c_consumer2() {
3536
/** Write an unbound method reference that clears the given list. */
3637
@Test
3738
@Disabled
38-
public void c_consumer3() {
39+
void c_consumer3() {
3940
Consumer<List<String>> cons = null; // TODO
4041

4142
List<String> list = new ArrayList<>(List.of("a", "b", "c"));
@@ -49,7 +50,7 @@ public void c_consumer3() {
4950
*/
5051
@Test
5152
@Disabled
52-
public void c_consumer4() {
53+
void c_consumer4() {
5354
Consumer<List<String>> c1 = list -> list.add("first");
5455
Consumer<List<String>> c2 = list -> list.add("second");
5556

0 commit comments

Comments
 (0)