Question: I am trying to create realms in keycloak using java.I am able to create realms from master realm but not by using the credentials of the other realm.

Is it only possible to create realm from the master realm? Can anyone help me?
Thanks in advance

Answer: 
There is no clean way of doing this, since the type of the Object parameter in `setValueAt` cannot be changed.

If you replace the following code, it will be as clean as you can get:

This is just for convenience (you don't need own lambdas):

```
private static List<ColDef<BauwerkOption, ?>> DEF = new ArrayList<>();
static {
    DEF.add(new ColDef<BauwerkOption, String>("A", BauwerkOption::getBauwerkstyp));
    DEF.add(new ColDef<BauwerkOption, String>("B", BauwerkOption::getBezeichnung).withSetValueAtFunction(BauwerkOption::setBauwerkstyp));
    DEF.add(new ColDef<BauwerkOption, String>("C", BauwerkOption::getNutzungsart));
    DEF.add(new ColDef<BauwerkOption, Double>("D", BauwerkOption::getDurchmesser));
}

```

In ColDef simply add this method without changing anything else:

```
@SuppressWarnings("unchecked")
public BiConsumer<InputObjekt, Object> getObjectValueSetterFunction() {
    return (BiConsumer<InputObjekt, Object>) valueSetterFunction;
}

```

And then replace setValueAt in TableModelSelektierung with:

```
@Override
public void setValueAt(Object aValue, int row, int column) {
    if (DEF.get(column).getValueSetterFunction() != null) {
        DEF.get(column).getObjectValueSetterFunction().accept(getObjectAt(row), aValue);
    }
}

```

Keeps your generics in place but works around the Object restriction you get from inheriting. You should probably add type checks in setValueAt to make sure the object parameter is of the correct type.
the message

```
The method accept(Selektierung.BauwerkOption, capture#4-of ? extends Object) in the type BiConsumer<Selektierung.BauwerkOption,capture#4-of ? extends Object> is not applicable for the arguments (Selektierung.BauwerkOption, Object)

```

says, that `DEF` is declared as a `list` of `ColDef<BauwerkOption, ? extends Object>` and expects something, that extends an `Object` and not an `Object` itself. so if you remove `? extends` from the declaration of `DEF`, it should work

**Edit**

to be more specific in your code, you could create Value-Object-Classes for `Bauwerkstyp`, `Bezeichnung`, `Nutzungsart`, `Durchmesser`, etc. that extend the Type you want, for example `String` or `Double` and implement an Interface

```
public ColDefStringValue implements IColDefValue<String> {
    @Override
    public String getValue() {
        return ...;
    }
}

```

the interface could look like this

```
public interface ColDefValue<T> {
    T getValue();
}

```

the Interface could be used instead of `? extends Object` or `Object`

```
private static List<ColDef<BauwerkOption, IColDefValue<?>>> DEF = new ArrayList<>();

```