@Test(expected = NullPointerException.class) public void chooseBetter_affMatchResult1_null() { AffMatchResult affMatchResult2 = new AffMatchResult(affiliation, organization_B, 0.7f); chooser.chooseBetter(null, affMatchResult2); }
public AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2) { Preconditions.checkNotNull(affMatchResult1); Preconditions.checkNotNull(affMatchResult2); if (Math.abs(affMatchResult1.getMatchStrength() - affMatchResult2.getMatchStrength()) < EPSILON) { return affMatchResult1; } if (affMatchResult1.getMatchStrength() > affMatchResult2.getMatchStrength()) { return affMatchResult1; } return affMatchResult2; }
AffMatchResultChooser implements Serializable { public AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2) { Preconditions.checkNotNull(affMatchResult1); Preconditions.checkNotNull(affMatchResult2); if (Math.abs(affMatchResult1.getMatchStrength() - affMatchResult2.getMatchStrength()) < EPSILON) { return affMatchResult1; } if (affMatchResult1.getMatchStrength() > affMatchResult2.getMatchStrength()) { return affMatchResult1; } return affMatchResult2; } }
AffMatchResultChooser implements Serializable { public AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2) { Preconditions.checkNotNull(affMatchResult1); Preconditions.checkNotNull(affMatchResult2); if (Math.abs(affMatchResult1.getMatchStrength() - affMatchResult2.getMatchStrength()) < EPSILON) { return affMatchResult1; } if (affMatchResult1.getMatchStrength() > affMatchResult2.getMatchStrength()) { return affMatchResult1; } return affMatchResult2; }  }
AffMatchResultChooser implements Serializable { public AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2) { Preconditions.checkNotNull(affMatchResult1); Preconditions.checkNotNull(affMatchResult2); if (Math.abs(affMatchResult1.getMatchStrength() - affMatchResult2.getMatchStrength()) < EPSILON) { return affMatchResult1; } if (affMatchResult1.getMatchStrength() > affMatchResult2.getMatchStrength()) { return affMatchResult1; } return affMatchResult2; }  AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2); }
AffMatchResultChooser implements Serializable { public AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2) { Preconditions.checkNotNull(affMatchResult1); Preconditions.checkNotNull(affMatchResult2); if (Math.abs(affMatchResult1.getMatchStrength() - affMatchResult2.getMatchStrength()) < EPSILON) { return affMatchResult1; } if (affMatchResult1.getMatchStrength() > affMatchResult2.getMatchStrength()) { return affMatchResult1; } return affMatchResult2; }  AffMatchResult chooseBetter(AffMatchResult affMatchResult1, AffMatchResult affMatchResult2);  }