@Test public void found_NO_block_when_children_block_has_only_2_entries() { StringBuilder sb = new StringBuilder(); sb.append("1234\n"); sb.append(" 8\n\n"); sb.append(" 8\n\n"); sb.append("1234\n"); String text = sb.toString(); List<IndentionBlock> result = builderToTest.build(text); assertEquals(0,result.size()); }
public List<IndentionBlock> build(String text) { String[] lines = LINE_SPLIT_PATTERN.split(text, -1); IndentContext context = new IndentContext(lines); for (int i = 0; i < lines.length; i++) { context.calculateIndentBlockForLineIfNecessary(i); } return context.list; }
IndentionBlockBuilder { public List<IndentionBlock> build(String text) { String[] lines = LINE_SPLIT_PATTERN.split(text, -1); IndentContext context = new IndentContext(lines); for (int i = 0; i < lines.length; i++) { context.calculateIndentBlockForLineIfNecessary(i); } return context.list; } }
IndentionBlockBuilder { public List<IndentionBlock> build(String text) { String[] lines = LINE_SPLIT_PATTERN.split(text, -1); IndentContext context = new IndentContext(lines); for (int i = 0; i < lines.length; i++) { context.calculateIndentBlockForLineIfNecessary(i); } return context.list; }  }
IndentionBlockBuilder { public List<IndentionBlock> build(String text) { String[] lines = LINE_SPLIT_PATTERN.split(text, -1); IndentContext context = new IndentContext(lines); for (int i = 0; i < lines.length; i++) { context.calculateIndentBlockForLineIfNecessary(i); } return context.list; }  List<IndentionBlock> build(String text); }
IndentionBlockBuilder { public List<IndentionBlock> build(String text) { String[] lines = LINE_SPLIT_PATTERN.split(text, -1); IndentContext context = new IndentContext(lines); for (int i = 0; i < lines.length; i++) { context.calculateIndentBlockForLineIfNecessary(i); } return context.list; }  List<IndentionBlock> build(String text);  }