### Question:
ImmutableQuality implements Quality { @Override public int compareTo(Quality that) { if(that==null) { return 1; } return ComparisonChain. start(). compare(this.type,that.type()). compare(this.weight,that.weight()). 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();  }### Answer:
@Test public void qualitiesAreGreaterThanNull() throws Exception { assertThat(VALUE.compareTo(null),equalTo(1)); }
@Test public void equalQualitiesAreOrderedEqually() throws Exception { assertThat(VALUE.compareTo(VALUE),equalTo(0)); }
@Test public void qualitiesOrderingDependsOnTypeFirst() throws Exception { assertThat(VALUE.compareTo(VALUE_SMALLER_TYPE),equalTo(1)); assertThat(VALUE_SMALLER_TYPE.compareTo(VALUE),equalTo(-1)); }
@Test public void qualitiesOrderingDependsOnWeightSecond() throws Exception { assertThat(VALUE.compareTo(VALUE_SMALLER_WEIGHT),equalTo(1)); assertThat(VALUE_SMALLER_WEIGHT.compareTo(VALUE),equalTo(-1)); }