1
2
3
4
5
6
7
8
9
10
11 package com.puppycrawl.tools.checkstyle.checks.coding.returncount;
12
13 import java.util.function.Predicate;
14
15
16 public class Example4 {
17 public Example4() {}
18
19 public Example4(int i) { return; }
20
21 public int signA(int x) {
22 if (x < -2) { return -1; }
23 return 0;
24 }
25
26 public int signB(int x) {
27 if (x < -2) { return -1; }
28 if (x == 0) { return 0; }
29 if (x > 2) { return 2; }
30 return 1;
31 }
32
33 final Predicate<Integer> lambdaA = i -> {
34 if (i > 5) { return true; }
35 return false;
36 };
37
38 final Predicate<Integer> lambdaB = i -> { return i > 5; };
39
40 public void methodA(int x) {}
41
42 public void methodB(int x) { return; }
43 }
44