GitRepository () { for (GitRepository repository : myRepositories) { if (!myCommits.get(repository).isEmpty()) { return repository; } } throw new AssertionError("The dialog shouldn't be shown. Unmerged commits: " + myCommits); }