Walks by list's nodes and extracts optional value of type T.
@param list subject
@param clazz value type
@param path nodes to walk in list
@param <T> value type
@return optional value of type T
433123
public static <T> Optional<T> get(final List list, final Class<T> clazz, final Integer... path) {
        if (path == null || path.length == 0) {
            throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED);
        }
        if (path.length == 1) {
            return Optional.ofNullable((T) list.get(path[0]));
        }
        final Integer[] pathToLastNode = Arrays.copyOfRange(path, 0, path.length - 1);
        final Integer lastKey = path[path.length - 1];
        List intermediateList = list;
        for (Integer index : pathToLastNode) {
            final Object node = intermediateList.get(index);
            if (node != null) {
                final Optional<List> nodeListOption = ClassApi.cast(node, List.class);
                if (nodeListOption.isPresent()) {
                    intermediateList = nodeListOption.get();
                } else {
                    throw new IllegalAccessError("Node with key '" + index + "' is not a list!");
                }
            } else {
                return Optional.empty();
            }
        }
        return Optional.ofNullable((T) intermediateList.get(lastKey));
    }
1236681
public boolean znodeIsMe(String path) {
        String value = ZKUtils.get(zk, path);
        return (value != null && value == myNodeID);
    }
1320338
public V getValue(List<P> path) {

        CmsPathTree<P, V> node = findNode(path);
        if (node != null) {
            return node.m_value;
        } else {
            return null;
        }
    }
1216178
@SuppressWarnings("unchecked")
	public TreeNode<T> findByPath(T... path) {
		return findByPath(Arrays.asList(path));
	}
59976
public static <T> T getUnsafe(final List list, final Class<T> clazz, final Integer... path) {
        return get(list, clazz, path).orElseThrow(() -> new IllegalAccessError(
            "List "
            + list
            + " does not have value of type "
            + clazz.getName()
            + " by "
            + Arrays.stream(path).map(Object::toString).collect(Collectors.joining(".")))
        );
    }
605663
public List<V> getDescendantValues(List<P> path) {

        CmsPathTree<P, V> node = findNode(path);
        List<V> result = Lists.newArrayList();
        if (node != null) {
            node.collectEntries(result);
        }
        return result;
    }
419176
public static Object getNullable(final List list, final Integer... path) {
        return getNullable(list, Object.class, path);
    }
522973
public static <T> Optional<T> getNullableOptional(final List list, final Class<T> clazz, final Integer... path) {
        return getNullable(list, Optional.class, path);
    }
660147
public static Optional<ConfigValue> getValueOptional(Config config, String path) {
        return Optional.ofNullable(getValue(config, path));
    }
320329
public void setValue(List<P> path, V value) {

        ensureNode(path).setValue(value);

    }
592154
public static List<String> getChildrenParentMayNotExist(ZkClient zkClient, String path) {
        try {
            return zkClient.getChildren(path);
        } catch (ZkNoNodeException e) {
            return null;
        }
    }
857589
public static <T> List<T> getNullableList(final Map map, final Class<T> clazz, final Object... path) {
        return (List<T>) getNullable(map, List.class, path);
    }
836975
static List<String> readLinesFromResource(String path)
    {
        String file = tryToLoadResource(path);

        if (file == null || file.isEmpty())
        {
            return Collections.emptyList();
        }

        String[] lines = file.split("\n");

        LOG.trace("Successfully read [{}] lines from resource [{}]", lines.length, path);
        return Arrays.asList(lines);
    }
711572
public static List<String> readListResource(String path)
    {
        Class<?> callerClass = resolveCaller();
        if (callerClass == null)
        {
            return null;
        }

        return readListResource(resolveCaller(), path);
    }
922956
public List<String> readAllLines(Path path, Charset cs)
    {
        try {
            return Files.readAllLines(path, cs);
        } catch (IOException e) {
            return null;
        }
    }
1021455
protected List<String> parseOptionalStringValues(final String path) {

        final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
        if (values == null) {
            return null;
        } else {
            List<String> stringValues = new ArrayList<String>(values.size());
            for (I_CmsXmlContentValue value : values) {
                stringValues.add(value.getStringValue(null));
            }
            return stringValues;
        }
    }
1099479
public <T> Optional<T> getDataAttrOptional(String dPath, Class<T> clazz) {
        return Optional.ofNullable(getDataAttr(dPath, clazz));
    }