for(RevCommit rev : stashes) {
System.out.println("Found stash: " + rev);
}
// drop the 1st stash without applying it
ObjectId call = git.stashDrop().setStashRef(0).call();
System.out.println("StashDrop returned: " + call);
ObjectId applied = git.stashApply().setStashRef(stash.getName()).call();
System.out.println("Applied 2nd stash as: " + applied);