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