@Test public void twoQualitiesAreEqualIfBothTypeAndWeightAreEqual() { assertThat(VALUE,equalTo(ImmutableQuality.create(TYPE, WEIGHT))); }
static ImmutableQuality create(final Type type, final double weight) { requireNonNull(type,"Quality type cannot be null"); checkQualityRange(weight, "Quality weight"); return new ImmutableQuality(weight, type); }
ImmutableQuality implements Quality { static ImmutableQuality create(final Type type, final double weight) { requireNonNull(type,"Quality type cannot be null"); checkQualityRange(weight, "Quality weight"); return new ImmutableQuality(weight, type); } }
ImmutableQuality implements Quality { static ImmutableQuality create(final Type type, final double weight) { requireNonNull(type,"Quality type cannot be null"); checkQualityRange(weight, "Quality weight"); return new ImmutableQuality(weight, type); } private  ImmutableQuality(double value, Type type); }
ImmutableQuality implements Quality { static ImmutableQuality create(final Type type, final double weight) { requireNonNull(type,"Quality type cannot be null"); checkQualityRange(weight, "Quality weight"); return new ImmutableQuality(weight, type); } 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 create(final Type type, final double weight) { requireNonNull(type,"Quality type cannot be null"); checkQualityRange(weight, "Quality weight"); return new ImmutableQuality(weight, type); } 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();  }