void () { int size = (int)mySize.getValue(); myValues = new ArrayList<>(size); for (int i = 0; i < size; i++) { try { T bin = myClass.getDeclaredConstructor().newInstance(); bin.setName("[" + i + "]"); myValues.add(bin); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException(e.getMessage()); } } }