### Question:
Validator { @VisibleForTesting static int precisionCompare(double a, double b, int precision) { return isClose(a, b, Math.pow(10, -1 * (precision - 1))) ? 0 : -1; } Validator(
            String controlGateway,
            String testGateway,
            Duration controlTimeout,
            Duration testTimeout,
            int maxRowCount,
            boolean explainOnly,
            int precision,
            boolean checkCorrectness,
            boolean checkDeterministic,
            boolean verboseResultsComparison,
            int controlTeardownRetries,
            int testTeardownRetries,
            boolean runTearDownOnResultMismatch,
            QueryPair queryPair); boolean isSkipped(); String getSkippedMessage(); boolean valid(); boolean isDeterministic(); QueryPair getQueryPair(); QueryResult getControlResult(); QueryResult getTestResult(); List<QueryResult> getControlPreQueryResults(); List<QueryResult> getControlPostQueryResults(); List<QueryResult> getTestPreQueryResults(); List<QueryResult> getTestPostQueryResults(); String getResultsComparison(int precision);  }### Answer:
@Test public void testDoubleComparison() { assertEquals(precisionCompare(0.9045, 0.9045000000000001, 3), 0); assertEquals(precisionCompare(0.9045, 0.9045000000000001, 2), 0); assertEquals(precisionCompare(0.9041, 0.9042, 3), 0); assertEquals(precisionCompare(0.9041, 0.9042, 4), 0); assertEquals(precisionCompare(0.9042, 0.9041, 4), 0); assertEquals(precisionCompare(-0.9042, -0.9041, 4), 0); assertEquals(precisionCompare(-0.9042, -0.9041, 3), 0); assertEquals(precisionCompare(0.899, 0.901, 3), 0); assertEquals(precisionCompare(NaN, NaN, 4), Double.compare(NaN, NaN)); }