snippets/data-in-processes/src/main/java/org/camunda/consulting/patterns/data/adapter/AbstractProcessVariableAdapter.java
@SuppressWarnings("unchecked")
  public static final <T extends Serializable> T castValue(final Object value) {
    return value != null ? (T) value : null;
  }
@SuppressWarnings("unchecked")
  public static final <T extends Serializable> T castValue(final Object value) {
    return value != null ? (T) value : null;
  }
Type- and null-safe cast of variable-value.