ConflictException extends Exception { CommitFailedException asCommitFailedException() { if (!conflictRevisions.isEmpty()) { return new FailedWithConflictException(conflictRevisions, getMessage(), this); } else { return new CommitFailedException(MERGE, 1, "Failed to merge changes to the underlying store", this); } } ConflictException(@NotNull String message,
                      @NotNull Revision conflictRevision);   ConflictException(@NotNull String message,
                      @NotNull Set<Revision> conflictRevisions);   ConflictException(@NotNull String message);   }
@Test public void type() { ConflictException e = new ConflictException("conflict"); CommitFailedException cfe = e.asCommitFailedException(); assertEquals(CommitFailedException.MERGE, cfe.getType()); }
@Test public void cause() { ConflictException e = new ConflictException("conflict"); CommitFailedException cfe = e.asCommitFailedException(); assertSame(e, cfe.getCause()); }
@Test public void asCommitFailedException() { Revision r = Revision.newRevision(1); ConflictException e = new ConflictException("conflict", r); CommitFailedException cfe = e.asCommitFailedException(); assertTrue(cfe instanceof FailedWithConflictException); FailedWithConflictException fwce = (FailedWithConflictException) cfe; assertEquals(CommitFailedException.MERGE, fwce.getType()); assertEquals(Collections.singleton(r), fwce.getConflictRevisions()); }