cp.applyConstraint(ConstrainedProperty.MIN_CONSTRAINT, 123.45d);
assertEquals(123.45d, cp.getMin());
// validate that getMin returns the correct value when the range constraint is defined for the property (but no min constraint is defined)
cp = new ConstrainedProperty(TestClass.class, "testDouble", Double.class);
cp.applyConstraint(ConstrainedProperty.RANGE_CONSTRAINT, new ObjectRange(123.45d, 678.9d));
assertEquals(123.45d, cp.getMin());
// validate that getMin returns the maximum of the min constraint and the lower bound of the range constraint
// 1) validate where the lower bound of the range constraint is greater than the min constraint
cp = new ConstrainedProperty(TestClass.class, "testDouble", Double.class);
cp.applyConstraint(ConstrainedProperty.MIN_CONSTRAINT, 1.23d);
cp.applyConstraint(ConstrainedProperty.RANGE_CONSTRAINT, new ObjectRange(4.56d, 7.89d));
assertEquals(4.56d, cp.getMin());
// 2) validate where the min constraint is greater than the lower bound of the range constraint
cp = new ConstrainedProperty(TestClass.class, "testDouble", Double.class);
cp.applyConstraint(ConstrainedProperty.MIN_CONSTRAINT, 4.56d);
cp.applyConstraint(ConstrainedProperty.RANGE_CONSTRAINT, new ObjectRange(1.23d, 7.89d));
assertEquals(4.56d, cp.getMin());
}