View Javadoc
1   /*
2   RightCurly
3   option = (default)SAME
4   tokens = (default)LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly;
10  
11  import java.util.stream.Collectors;
12  import java.util.stream.Stream;
13  
14  public class InputRightCurlyTestIsSameLambda {
15  
16      static Runnable r1 = () -> {
17          String.valueOf("Test rightCurly one!");
18      };
19  
20      static Runnable r2 = () -> String.valueOf("Test rightCurly two!");
21  
22      static Runnable r3 = () -> {String.valueOf("Test rightCurly three!");};
23  
24      static Runnable r4 = () -> {
25          String.valueOf("Test rightCurly four!");};
26  
27      static Runnable r5 = () ->
28      {
29          String.valueOf("Test rightCurly five!");
30      };
31  
32      static Runnable r6 = () -> {};
33  
34      static Runnable r7 = () -> {
35      };
36  
37      static Runnable r8 = () ->
38      {
39      };
40  
41      static Runnable r9 = () -> {
42          String.valueOf("Test rightCurly nine!");
43      }; int i;
44  
45      void foo1() {
46          Stream.of("Hello").filter(s -> {
47                  return s != null;
48              }
49          ).collect(Collectors.toList());
50  
51          Stream.of("Hello").filter(s -> {
52                  return s != null;
53          }).collect(Collectors.toList());
54  
55          Stream.of("Hello").filter(s -> {return s != null;})
56                  .collect(Collectors.toList());
57  
58          Stream.of("Hello").filter(s -> {return s != null;}).collect(Collectors.toList());
59  
60          Stream.of("Hello").filter(s -> {
61              return s != null;}).collect(Collectors.toList());
62  
63          bar(() -> {return;}, () -> {return;});
64  
65          bar(() -> {
66              return;
67          }, () -> {return;});
68  
69          bar(() -> {
70              return;
71          }, () -> {
72              return;
73          });
74  
75          bar(() -> {
76              return;}, () -> {return;});
77  
78          bar(() -> {
79              return;
80          }, () -> {
81              return;});
82  
83      }
84  
85      void bar(Runnable r1, Runnable r2) { }
86  }