List<Block> (List<? extends ASTNode> nodes) { List<ChainedCallChunk> methodCall = splitMethodCallOnChunksByDots(nodes); Wrap wrap = Wrap.createWrap(getWrapType(mySettings.METHOD_CALL_CHAIN_WRAP), true); Wrap builderMethodWrap = Wrap.createWrap(WrapType.ALWAYS, true); Alignment chainedCallsAlignment = null; List<Block> blocks = new ArrayList<>(); int commonIndentSize = mySettings.KEEP_BUILDER_METHODS_INDENTS ? getCommonIndentSize(methodCall) : -1; CallChunkBlockBuilder builder = new CallChunkBlockBuilder(mySettings, myJavaSettings, myFormattingMode); for (int i = 0; i < methodCall.size(); i++) { ChainedCallChunk currentCallChunk = methodCall.get(i); if (isMethodCall(currentCallChunk) && !isBuilderMethod(currentCallChunk) || isComment(currentCallChunk)) { if (chainedCallsAlignment == null) { chainedCallsAlignment = createCallChunkAlignment(i, methodCall); } } else { chainedCallsAlignment = null; } Wrap currWrap = isMethodCall(currentCallChunk) && canWrap(i, methodCall) ? isBuilderMethod(currentCallChunk) ? builderMethodWrap : wrap : null; blocks.add(builder.create(currentCallChunk.nodes, currWrap, chainedCallsAlignment, getRelativeIndentSize(commonIndentSize, currentCallChunk))); } return blocks; }