Builder (boolean hasChildren) { // probably LogEntry interface will be changed and child entries will be specified explicitly later, but for now just use such "fake" // implementation for setting "hasChildren" value childEntries.clear(); if (hasChildren) { childEntries.add(this); } return this; }