@Test public void doesNotCopyImmutableAlternatives(@Mocked final ImmutableAlternative alternative) throws Exception { assertThat(ImmutableAlternative.copyOf(alternative),sameInstance(alternative)); }
static ImmutableAlternative copyOf(Alternative predefined) { ImmutableAlternative result=null; if(predefined instanceof ImmutableAlternative) { result=(ImmutableAlternative)predefined; } else if(predefined!=null) { result=create(predefined.quality(),ImmutableVariant.copyOf(predefined)); } return result; }
ImmutableAlternative implements Alternative { static ImmutableAlternative copyOf(Alternative predefined) { ImmutableAlternative result=null; if(predefined instanceof ImmutableAlternative) { result=(ImmutableAlternative)predefined; } else if(predefined!=null) { result=create(predefined.quality(),ImmutableVariant.copyOf(predefined)); } return result; } }
ImmutableAlternative implements Alternative { static ImmutableAlternative copyOf(Alternative predefined) { ImmutableAlternative result=null; if(predefined instanceof ImmutableAlternative) { result=(ImmutableAlternative)predefined; } else if(predefined!=null) { result=create(predefined.quality(),ImmutableVariant.copyOf(predefined)); } return result; } private  ImmutableAlternative(final double quality, final ImmutableVariant variant); }
ImmutableAlternative implements Alternative { static ImmutableAlternative copyOf(Alternative predefined) { ImmutableAlternative result=null; if(predefined instanceof ImmutableAlternative) { result=(ImmutableAlternative)predefined; } else if(predefined!=null) { result=create(predefined.quality(),ImmutableVariant.copyOf(predefined)); } return result; } private  ImmutableAlternative(final double quality, final ImmutableVariant variant); @Override double quality(); @Override MediaType type(); @Override CharacterEncoding charset(); @Override Language language(); @Override String toString(); }
ImmutableAlternative implements Alternative { static ImmutableAlternative copyOf(Alternative predefined) { ImmutableAlternative result=null; if(predefined instanceof ImmutableAlternative) { result=(ImmutableAlternative)predefined; } else if(predefined!=null) { result=create(predefined.quality(),ImmutableVariant.copyOf(predefined)); } return result; } private  ImmutableAlternative(final double quality, final ImmutableVariant variant); @Override double quality(); @Override MediaType type(); @Override CharacterEncoding charset(); @Override Language language(); @Override String toString();  }