@Test public void doesNotCloneNull() throws Exception { ImmutableLanguage original = null; ImmutableLanguage copy = ImmutableLanguage.copyOf(original); assertThat(copy,sameInstance(original)); }
static ImmutableCharacterEncoding copyOf(CharacterEncoding characterEncoding) { ImmutableCharacterEncoding result=null; if(characterEncoding instanceof ImmutableCharacterEncoding) { result=(ImmutableCharacterEncoding)characterEncoding; } else if(characterEncoding!=null) { result=new ImmutableCharacterEncoding(characterEncoding.charset()); } return result; }
ImmutableCharacterEncoding implements CharacterEncoding { static ImmutableCharacterEncoding copyOf(CharacterEncoding characterEncoding) { ImmutableCharacterEncoding result=null; if(characterEncoding instanceof ImmutableCharacterEncoding) { result=(ImmutableCharacterEncoding)characterEncoding; } else if(characterEncoding!=null) { result=new ImmutableCharacterEncoding(characterEncoding.charset()); } return result; } }
ImmutableCharacterEncoding implements CharacterEncoding { static ImmutableCharacterEncoding copyOf(CharacterEncoding characterEncoding) { ImmutableCharacterEncoding result=null; if(characterEncoding instanceof ImmutableCharacterEncoding) { result=(ImmutableCharacterEncoding)characterEncoding; } else if(characterEncoding!=null) { result=new ImmutableCharacterEncoding(characterEncoding.charset()); } return result; } ImmutableCharacterEncoding(Charset charset); }
ImmutableCharacterEncoding implements CharacterEncoding { static ImmutableCharacterEncoding copyOf(CharacterEncoding characterEncoding) { ImmutableCharacterEncoding result=null; if(characterEncoding instanceof ImmutableCharacterEncoding) { result=(ImmutableCharacterEncoding)characterEncoding; } else if(characterEncoding!=null) { result=new ImmutableCharacterEncoding(characterEncoding.charset()); } return result; } ImmutableCharacterEncoding(Charset charset); @Override boolean isWildcard(); @Override String name(); @Override Charset charset(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
ImmutableCharacterEncoding implements CharacterEncoding { static ImmutableCharacterEncoding copyOf(CharacterEncoding characterEncoding) { ImmutableCharacterEncoding result=null; if(characterEncoding instanceof ImmutableCharacterEncoding) { result=(ImmutableCharacterEncoding)characterEncoding; } else if(characterEncoding!=null) { result=new ImmutableCharacterEncoding(characterEncoding.charset()); } return result; } ImmutableCharacterEncoding(Charset charset); @Override boolean isWildcard(); @Override String name(); @Override Charset charset(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }