### Question:
GitHistoryParser { @VisibleForTesting static void sortByDate(final Map<String, List<Revision>> histories) { final Comparator<Revision> comparator = (o1, o2) -> o2.getDate().compareTo(o1.getDate()); for (final List<Revision> revisions : histories.values()) { revisions.sort(comparator); } } private  GitHistoryParser(
            final RevWalk revWalk,
            final DiffFormatter diffFormatter,
            final String definitionDirectory
    );   }### Answer:
@Test public void testSortByDate() { final Map<String, List<Revision>> testee = Maps.newHashMap(); testee.put("test1", Lists.newArrayList( makeRandomRevision(5), makeRandomRevision(8), makeRandomRevision(1) )); testee.put("test2", Lists.newArrayList( makeRandomRevision(10) )); GitHistoryParser.sortByDate(testee); for (final List<Revision> revisions : testee.values()) { Date prevDate = revisions.get(0).getDate(); for (final Revision revision : revisions) { assertTrue(prevDate.compareTo(revision.getDate()) >= 0); prevDate = revision.getDate(); } } }