}
unset = false;
symbols.clear();
for (GraphicalSymbol graphicalSymbol : graphic.graphicalSymbols()) {
if (graphicalSymbol instanceof Symbol) {
Symbol symbol = (Symbol) graphicalSymbol;
Builder<? extends Symbol> builder;
if (symbol instanceof Mark) {
builder = new MarkBuilder(this).reset((Mark) symbol);
} else if (symbol instanceof ExternalGraphic) {
builder = new ExternalGraphicBuilder(this).reset((ExternalGraphic) symbol);
} else {
throw new IllegalArgumentException("Unrecognized symbol type: "
+ symbol.getClass());
}
if (builder != null) {
symbols.add(builder);
} else {
throw new RuntimeException("Failed to clone a builder for symbol: " + symbol);