import java.util.List; import java.util.Collection; class BuilderSingularLists { private List children; private Collection scarves; @SuppressWarnings("all") private List rawList; @java.lang.SuppressWarnings("all") BuilderSingularLists(final List children, final Collection scarves, final List rawList) { this.children = children; this.scarves = scarves; this.rawList = rawList; } @java.lang.SuppressWarnings("all") public static class BuilderSingularListsBuilder { private java.util.ArrayList children; private java.util.ArrayList scarves; private java.util.ArrayList rawList; @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder() { } @java.lang.SuppressWarnings("all") public BuilderSingularListsBuilder child(final T child) { if (this.children == null) this.children = new java.util.ArrayList(); this.children.add(child); return this; } @java.lang.SuppressWarnings("all") public BuilderSingularListsBuilder children(final java.util.Collection children) { if (this.children == null) this.children = new java.util.ArrayList(); this.children.addAll(children); return this; } @java.lang.SuppressWarnings("all") public BuilderSingularListsBuilder scarf(final Number scarf) { if (this.scarves == null) this.scarves = new java.util.ArrayList(); this.scarves.add(scarf); return this; } @java.lang.SuppressWarnings("all") public BuilderSingularListsBuilder scarves(final java.util.Collection scarves) { if (this.scarves == null) this.scarves = new java.util.ArrayList(); this.scarves.addAll(scarves); return this; } @java.lang.SuppressWarnings("all") public BuilderSingularListsBuilder rawList(final java.lang.Object rawList) { if (this.rawList == null) this.rawList = new java.util.ArrayList(); this.rawList.add(rawList); return this; } @java.lang.SuppressWarnings("all") public BuilderSingularListsBuilder rawList(final java.util.Collection rawList) { if (this.rawList == null) this.rawList = new java.util.ArrayList(); this.rawList.addAll(rawList); return this; } @java.lang.SuppressWarnings("all") public BuilderSingularLists build() { java.util.List children; switch (this.children == null ? 0 : this.children.size()) { case 0: children = java.util.Collections.emptyList(); break; case 1: children = java.util.Collections.singletonList(this.children.get(0)); break; default: children = new java.util.ArrayList(this.children.size()); children.addAll(this.children); children = java.util.Collections.unmodifiableList(children); } java.util.List scarves; switch (this.scarves == null ? 0 : this.scarves.size()) { case 0: scarves = java.util.Collections.emptyList(); break; case 1: scarves = java.util.Collections.singletonList(this.scarves.get(0)); break; default: scarves = new java.util.ArrayList(this.scarves.size()); scarves.addAll(this.scarves); scarves = java.util.Collections.unmodifiableList(scarves); } java.util.List rawList; switch (this.rawList == null ? 0 : this.rawList.size()) { case 0: rawList = java.util.Collections.emptyList(); break; case 1: rawList = java.util.Collections.singletonList(this.rawList.get(0)); break; default: rawList = new java.util.ArrayList(this.rawList.size()); rawList.addAll(this.rawList); rawList = java.util.Collections.unmodifiableList(rawList); } return new BuilderSingularLists(children, scarves, rawList); } @java.lang.Override @java.lang.SuppressWarnings("all") public java.lang.String toString() { return "BuilderSingularLists.BuilderSingularListsBuilder(children=" + this.children + ", scarves=" + this.scarves + ", rawList=" + this.rawList + ")"; } } @java.lang.SuppressWarnings("all") public static BuilderSingularListsBuilder builder() { return new BuilderSingularListsBuilder(); } }