Gathering metadata on files in GitHub
Java 8

Since you are on Java 8, you should consider using its stream-based processing feature to achieve what you need in a more expressive way.

First, you need a method that accepts a TreeEntry and gives you the desired Map object:

private Map&lt;String, Object&gt; extractDetails(TreeEntry file) {
    Map&lt;String, Object&gt; map = new HashMap&lt;&gt;();
    map.put("sha", file.getSha());
    map.put("path", file.getPath());
    map.put("name", GitHubHelper.getNameFromPath(file.getPath()));
    map.put("size", Objects.toString(file.getSize()));
    map.put("commits", GitHubHelper.getCommits(config, repo, file.getPath()));
    return map;
}


The idea here is to be able to use this as a method reference, e.g. ThisClass::extractDetails, for map()-ping the filter()-ed elements, before collect()-ing toList():

// Assuming fileList is a Collection implementation
List&lt;Map&lt;String, Object&gt;&gt; files = fileList.stream().filter(f -&gt; "blob".equals(f.getType()))
                                            .map(ThisClass::extractDetails)
                                            .collect(Collectors.toList());


Double brace initialization

This StackOverflow question shows the pitfalls of using it. In short, yes, there will be a performance impact, and it doesn't end there. Due to the anonymous classes it creates, you may get an unusual number of compiled class files, and not to mention the small but significant gotchas surrounding class equivalence testing (potentially) and final classes.