The name of a Note is the id of the object the note was attached to. See this
Git repo = ...
new FileWriter(new File(repo.getRepository().getWorkTree(), "f.txt")).write("hello world");
repo.add().addFilepattern("f.txt").call();
RevCommit commit = repo.commit().setMessage("tests").call();
System.out.println("created commit with id: "+commit.getId());
repo.notesAdd().setObjectId(commit).setMessage("content of Note").call();
for (Note n : repo.notesList().call())
System.out.println("Found note on object "+n.getName()+", data: "+n.getData());
You can also lookup the note for a specific commit by using the NoteMap class.
// better way to search for notes. Look up how to do it in ListNotesCommand.java
RevWalk walk = new RevWalk(repo);
NoteMap map = NoteMap.newEmptyMap();
Ref ref = repo.getRef("refs/notes/commits");
if (ref != null) {
RevCommit notesCommit = walk.parseCommit(ref.getObjectId());
map = NoteMap.read(walk.getObjectReader(), notesCommit);
map.getNote(notesCommit.getId());