1 package com.google.checkstyle.test.chapter4formatting.rule42blockindentation;
2
3
4 public class ClassWithChainedMethods {
5
6
7 public ClassWithChainedMethods(Object... params) {}
8
9
10 public static void main(String[] args) {
11 new ClassWithChainedMethods()
12 .getInstance("string_one")
13 .doNothing("string_one".trim(), "string_two");
14
15
16 int length =
17 new ClassWithChainedMethods("param1", "param2").getInstance().doNothing("nothing").length();
18
19
20 int length2 =
21 new ClassWithChainedMethods("param1", "param2").getInstance().doNothing("nothing").length();
22
23 }
24
25
26 public String doNothing(String something, String... uselessParams) {
27 return something;
28 }
29
30
31 public ClassWithChainedMethods getInstance(String... uselessParams) {
32 return this;
33 }
34 }