private void putCache(String mode, String query, List<? extends LexicalEntry> entries) {
if (cache == null) return;
String key = mode + ":" + query;
LispTree result = LispTree.proto.newList();
for (LexicalEntry entry : entries)
result.addChild(LexicalEntrySerializer.entryToLispTree(entry));
synchronized (cache) {
cache.put(key, result.toString());
}
}
}