// Path: core/src/main/java/com/github/filosganga/geogson/util/Preconditions.java
// public static <T> T checkArgument(T argument, Function<T, Boolean> predicate, Object errorMessage) {
//     if (!predicate.apply(argument)) {
//         throw new IllegalArgumentException(String.valueOf(errorMessage));
//     } else {
//         return argument;
//     }
// }


import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static com.github.filosganga.geogson.util.Preconditions.checkArgument;
package com.github.filosganga.geogson.model.positions;



/**
 * Abstract implementation of {@link Positions}. Provides some basic methods.
 */
public abstract class AbstractPositions<T extends Positions> implements Positions {

    private static final long serialVersionUID = 1L;

    protected final List<T> children;

    private transient Integer cachedSize = null;
    private transient Integer cachedHashCode = null;

    AbstractPositions(List<T> children) {
// Path: core/src/main/java/com/github/filosganga/geogson/util/Preconditions.java
// public static <T> T checkArgument(T argument, Function<T, Boolean> predicate, Object errorMessage) {
//     if (!predicate.apply(argument)) {
//         throw new IllegalArgumentException(String.valueOf(errorMessage));
//     } else {
//         return argument;
//     }
// }


// Path: core/src/main/java/com/github/filosganga/geogson/model/positions/AbstractPositions.java
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static com.github.filosganga.geogson.util.Preconditions.checkArgument;

package com.github.filosganga.geogson.model.positions;



/**
 * Abstract implementation of {@link Positions}. Provides some basic methods.
 */
public abstract class AbstractPositions<T extends Positions> implements Positions {

    private static final long serialVersionUID = 1L;

    protected final List<T> children;

    private transient Integer cachedSize = null;
    private transient Integer cachedHashCode = null;

    AbstractPositions(List<T> children) {
        this.children = checkArgument(children, Objects::nonNull, "The children cannot be null");