@Test public void copyOfDoesNotCloneImmutableInstances() { assertThat(ImmutableQuality.copyOf(VALUE),sameInstance(VALUE)); }
static ImmutableQuality copyOf(Quality quality) { ImmutableQuality result=null; if(quality instanceof ImmutableQuality) { result=(ImmutableQuality)quality; } else { result=create(quality.type(),quality.weight()); } return result; }
ImmutableQuality implements Quality { static ImmutableQuality copyOf(Quality quality) { ImmutableQuality result=null; if(quality instanceof ImmutableQuality) { result=(ImmutableQuality)quality; } else { result=create(quality.type(),quality.weight()); } return result; } }
ImmutableQuality implements Quality { static ImmutableQuality copyOf(Quality quality) { ImmutableQuality result=null; if(quality instanceof ImmutableQuality) { result=(ImmutableQuality)quality; } else { result=create(quality.type(),quality.weight()); } return result; } private  ImmutableQuality(double value, Type type); }
ImmutableQuality implements Quality { static ImmutableQuality copyOf(Quality quality) { ImmutableQuality result=null; if(quality instanceof ImmutableQuality) { result=(ImmutableQuality)quality; } else { result=create(quality.type(),quality.weight()); } return result; } private  ImmutableQuality(double value, Type type); @Override Type type(); @Override double weight(); @Override int compareTo(Quality that); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); }
ImmutableQuality implements Quality { static ImmutableQuality copyOf(Quality quality) { ImmutableQuality result=null; if(quality instanceof ImmutableQuality) { result=(ImmutableQuality)quality; } else { result=create(quality.type(),quality.weight()); } return result; } private  ImmutableQuality(double value, Type type); @Override Type type(); @Override double weight(); @Override int compareTo(Quality that); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }