@Test void displayWithConflicts() throws Exception { List<String> previous = readLines("previous.txt"); List<String> current = readLines("twoContexts.txt"); List<String> next = readLines("twoContexts_next.txt"); MergeResult<String> mergeResult = getDiffManager().merge(previous, next, current, null); assertEquals(1, mergeResult.getConflicts().size()); DiffResult<String> diffResult = getDiffManager().diff(previous, next, null); List<UnifiedDiffBlock<String, Object>> unifiedDiffBlocks = unifiedDiffDisplayer.display(diffResult); assertEquals(2, unifiedDiffBlocks.size()); assertFalse(unifiedDiffBlocks.get(0).isConflicting()); assertFalse(unifiedDiffBlocks.get(1).isConflicting()); unifiedDiffBlocks = unifiedDiffDisplayer.display(diffResult, mergeResult.getConflicts()); assertEquals(4, unifiedDiffBlocks.size()); assertFalse(unifiedDiffBlocks.get(0).isConflicting()); assertFalse(unifiedDiffBlocks.get(1).isConflicting()); assertTrue(unifiedDiffBlocks.get(2).isConflicting()); assertFalse(unifiedDiffBlocks.get(3).isConflicting()); assertEquals(3, unifiedDiffBlocks.get(1).size()); assertEquals(2, unifiedDiffBlocks.get(2).size()); UnifiedDiffConflictElement<String> unifiedDiffConflictElement = unifiedDiffBlocks.get(2).getConflict(); assertEquals(Collections.singletonList(" unifiedDiffConflictElement.getPreviousElement()); assertEquals(Collections.singletonList(" unifiedDiffConflictElement.getCurrentElement()); assertEquals(Collections.singletonList(" unifiedDiffConflictElement.getNextElement()); }
@Override public <E, F> List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult) { return display(diffResult, this.<E, F>getDefaultConfiguration()); }
DefaultUnifiedDiffDisplayer implements UnifiedDiffDisplayer { @Override public <E, F> List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult) { return display(diffResult, this.<E, F>getDefaultConfiguration()); } }
DefaultUnifiedDiffDisplayer implements UnifiedDiffDisplayer { @Override public <E, F> List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult) { return display(diffResult, this.<E, F>getDefaultConfiguration()); }  }
DefaultUnifiedDiffDisplayer implements UnifiedDiffDisplayer { @Override public <E, F> List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult) { return display(diffResult, this.<E, F>getDefaultConfiguration()); }  @Override UnifiedDiffConfiguration<E, F> getDefaultConfiguration(); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult, List<Conflict<E>> conflicts); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult, UnifiedDiffConfiguration<E, F> config); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult, List<Conflict<E>> conflicts,
        UnifiedDiffConfiguration<E, F> config); }
DefaultUnifiedDiffDisplayer implements UnifiedDiffDisplayer { @Override public <E, F> List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult) { return display(diffResult, this.<E, F>getDefaultConfiguration()); }  @Override UnifiedDiffConfiguration<E, F> getDefaultConfiguration(); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult, List<Conflict<E>> conflicts); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult, UnifiedDiffConfiguration<E, F> config); @Override List<UnifiedDiffBlock<E, F>> display(DiffResult<E> diffResult, List<Conflict<E>> conflicts,
        UnifiedDiffConfiguration<E, F> config);  }