RelationChecker { public boolean checkDoubleRelation(double doubleValue, double number, BooleanRelation relation) { switch (relation) { default: case EQUAL: return doubleValue == number; case NOT_EQUAL: return doubleValue != number; case GREATER_THAN: return doubleValue > number; case LESS_THAN: return doubleValue < number; case GREATER_THAN_EQUAL: return doubleValue >= number; case LESS_THAN_EQUAL: return doubleValue <= number; } }  boolean checkDoubleRelation(double doubleValue, double number, BooleanRelation relation);  }
@Test public void testCheckDoubleRelation() throws Exception { RelationChecker relationChecker = new RelationChecker(); assertThat(relationChecker.checkDoubleRelation(first, second, relation), is(result)); }