@NotNull @Override public ThriftCompilerOptions createCopy() { final ThriftCompilerOptions s = new ThriftCompilerOptions(); final List<Generator> list = s.generators; list.clear(); try { for (Generator g : generators) { list.add(g.clone()); } } catch (CloneNotSupportedException e) { throw new RuntimeException("Failed to clone generator settings"); } s.includes.clear(); s.includes.addAll(includes); s.cleanOutput = cleanOutput; return s; }