### Question:
LinearTranslation { public LinearTranslation(double in1, double out1, double in2, double out2) { if (Math.abs(in1 - in2) < EQUALITY_TOLERANCE) { throw new IllegalArgumentException("in1 and in2 are approximately equal"); } double divisor = in1 - in2; this.m = (out1 - out2) / divisor; this.b = (in1 * out2 - in2 * out1) / divisor; } LinearTranslation(double in1, double out1, double in2, double out2); double translate(double in);  }### Answer:
@Test public void linearTranslation() { LinearTranslation ctof = new LinearTranslation(0, 32, 100, 212); assertEquals(32, ctof.translate(0), CLOSE_ENOUGH); assertEquals(212, ctof.translate(100), CLOSE_ENOUGH); assertEquals(98.6, ctof.translate(37), CLOSE_ENOUGH); assertEquals(-40, ctof.translate(-40), CLOSE_ENOUGH); LinearTranslation reversed = new LinearTranslation(5, 42, 69, 0); assertEquals(-21, reversed.translate(101), CLOSE_ENOUGH); }