private <T> T getSingleValue(List<T> values) {

        if (values == null || values.size() != 1)
            return null;

        return values.get(0);

    }
Returns the single value stored in the given list. If the list is empty
or contains multiple values, null is returned. Note that null will also
be returned if the single value stored in the list is itself null.

@param <T>
    The type of object stored in the list.

@param values
    The list to retrieve a single value from.

@return
    The single value stored in the given list, or null if the list is
    empty or contains multiple values.
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmRecordService.java