class AbstractProperty extends AbstractObservableValue<T> implements SettableValue<T> {

  @NotNull
  public static List<AbstractProperty<?>> getAll(Object object) {
    ArrayList<AbstractProperty<?>> properties = new ArrayList<>();
    for (Field field : object.getClass().getDeclaredFields()) {
      if (AbstractProperty.class.isAssignableFrom(field.getType())) {
        try {
          // We change the access level of this field to avoid getting an IllegalAccessException.
          boolean isFieldPrivate = !field.isAccessible();
          field.setAccessible(true);
          properties.add((AbstractProperty<?>)field.get(object));
          if (isFieldPrivate) {
            field.setAccessible(false);
          }
        }
        catch (IllegalAccessException ignored) {
        }
      }
    }
    return properties;
  }

}