int (ASTNode leftNode) { // The general idea is to return zero in situation when opening curly braces goes one after other, e.g. // new Expectations() {{ // foo();}} // We don't want line feed between closing curly braces here. if (leftNode == null || leftNode.getElementType() != JavaElementType.CLASS_INITIALIZER) { return 1; } ASTNode lbraceCandidate = leftNode.getTreePrev(); return lbraceCandidate != null && lbraceCandidate.getElementType() == JavaTokenType.LBRACE ? 0 : 1; }