@Test public void testClone() throws CloneNotSupportedException { AuthToLocalBuilder builder = new AuthToLocalBuilder("EXAMPLE.COM", Collections.<String>emptyList(), false); builder.addRule("nn/_HOST@EXAMPLE.COM", "hdfs"); builder.addRule("dn/_HOST@EXAMPLE.COM", "hdfs"); builder.addRule("jn/_HOST@EXAMPLE.COM", "hdfs"); builder.addRule("rm/_HOST@EXAMPLE.COM", "yarn"); builder.addRule("jhs/_HOST@EXAMPLE.COM", "mapred"); builder.addRule("hm/_HOST@EXAMPLE.COM", "hbase"); builder.addRule("rs/_HOST@EXAMPLE.COM", "hbase"); builder.addRule("foobar@EXAMPLE.COM", "hdfs"); AuthToLocalBuilder copy = (AuthToLocalBuilder) builder.clone(); assertNotSame(builder, copy); assertEquals(builder.generate(), copy.generate()); builder.addRule("user@EXAMPLE.COM", "hdfs"); assertTrue(!copy.generate().equals(builder.generate())); }
@Override public Object clone() throws CloneNotSupportedException { AuthToLocalBuilder copy = (AuthToLocalBuilder) super.clone(); copy.setRules = new TreeSet<Rule>(setRules); return copy; }
AuthToLocalBuilder implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { AuthToLocalBuilder copy = (AuthToLocalBuilder) super.clone(); copy.setRules = new TreeSet<Rule>(setRules); return copy; } }
AuthToLocalBuilder implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { AuthToLocalBuilder copy = (AuthToLocalBuilder) super.clone(); copy.setRules = new TreeSet<Rule>(setRules); return copy; } AuthToLocalBuilder(String defaultRealm, String additionalRealms, boolean caseInsensitiveUserSupport);  AuthToLocalBuilder(String defaultRealm, Collection<String> additionalRealms, boolean caseInsensitiveUserSupport); }
AuthToLocalBuilder implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { AuthToLocalBuilder copy = (AuthToLocalBuilder) super.clone(); copy.setRules = new TreeSet<Rule>(setRules); return copy; } AuthToLocalBuilder(String defaultRealm, String additionalRealms, boolean caseInsensitiveUserSupport);  AuthToLocalBuilder(String defaultRealm, Collection<String> additionalRealms, boolean caseInsensitiveUserSupport); @Override Object clone(); void addRules(String authToLocalRules); void addRule(String principal, String localUsername); String generate(); String generate(ConcatenationType concatenationType); }
AuthToLocalBuilder implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { AuthToLocalBuilder copy = (AuthToLocalBuilder) super.clone(); copy.setRules = new TreeSet<Rule>(setRules); return copy; } AuthToLocalBuilder(String defaultRealm, String additionalRealms, boolean caseInsensitiveUserSupport);  AuthToLocalBuilder(String defaultRealm, Collection<String> additionalRealms, boolean caseInsensitiveUserSupport); @Override Object clone(); void addRules(String authToLocalRules); void addRule(String principal, String localUsername); String generate(); String generate(ConcatenationType concatenationType); static final ConcatenationType DEFAULT_CONCATENATION_TYPE; }