LimitedComparableProperty extends SimpleObjectProperty<T> implements LimitedProperty<T> { @Override public void set(T t) { if (t != null) { t = Comparables.toRange(t, getMin(), getMax()); } super.set(t); } LimitedComparableProperty();  LimitedComparableProperty(T initialValue);  LimitedComparableProperty(Object bean, String name);  LimitedComparableProperty(Object bean, String name, T initialValue);  LimitedComparableProperty(T min, T max);  LimitedComparableProperty(T initialValue, T min, T max);  LimitedComparableProperty(Object bean, String name, T min, T max);  LimitedComparableProperty(Object bean, String name, T initialValue, T min, T max); @Override ObjectProperty<T> minProperty(); @Override final T getMin(); @Override final void setMin(T min); @Override ObjectProperty<T> maxProperty(); @Override final T getMax(); @Override final void setMax(T max); @Override void set(T t);  }
@Test public void testSet() { test.set(1); assertEquals(1, test.get().intValue()); test.set(11); assertEquals(11, test.get().intValue()); test.set(-1); assertEquals(-1, test.get().intValue()); test.set(null); assertNull(test.get()); }