class ObjectFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor
    public static Object itemAt(ItemAt itemAt, List<Object> inputs) {
        if (inputs == null) {
            return null;
        }

        Integer index = itemAt.getIndex() == null ? 0 : itemAt.getIndex();
        Object[] array = inputs.toArray(new Object[0]);
        if (array.length > index) {
            return array[index];
        } else {
            throw new ArrayIndexOutOfBoundsException(String.format(
                    "Collection '%s' has fewer (%s) than expected (%s)", array, array.length, index));
        }
    }

}