// Path: src/main/java/com/github/davidmoten/rtree/geometry/Geometry.java
// public interface Geometry {
// 
//     /**
//      * <p>
//      * Returns the distance to the given {@link Rectangle}. For a {@link Rectangle}
//      * this might be Euclidean distance but for an EPSG4326 lat-long Rectangle might
//      * be great-circle distance. The distance function should satisfy the following
//      * properties:
//      * </p>
//      * 
//      * <p>
//      * <code>distance(r) &gt;= 0</code>
//      * </p>
//      * 
//      * <p>
//      * <code>if r1 contains r2 then distance(r1)&lt;=distance(r2)</code>
//      * </p>
//      * 
//      * 
//      * @param r
//      *            rectangle to measure distance to
//      * @return distance to the rectangle r from the geometry
//      */
//     double distance(Rectangle r);
// 
//     /**
//      * Returns the minimum bounding rectangle of this geometry.
//      * 
//      * @return minimum bounding rectangle
//      */
//     Rectangle mbr();
// 
//     boolean intersects(Rectangle r);
// 
//     boolean isDoublePrecision();
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree/internal/NonLeafDefault.java
// public final class NonLeafDefault<T, S extends Geometry> implements NonLeaf<T, S> {
// 
//     private final List<? extends Node<T, S>> children;
//     private final Rectangle mbr;
//     private final Context<T, S> context;
// 
//     public NonLeafDefault(List<? extends Node<T, S>> children, Context<T, S> context) {
//         Preconditions.checkArgument(!children.isEmpty());
//         this.context = context;
//         this.children = children;
//         this.mbr = Util.mbr(children);
//     }
// 
//     @Override
//     public Geometry geometry() {
//         return mbr;
//     }
// 
//     @Override
//     public void searchWithoutBackpressure(Func1<? super Geometry, Boolean> criterion,
//             Subscriber<? super Entry<T, S>> subscriber) {
//         NonLeafHelper.search(criterion, subscriber, this);
//     }
// 
//     @Override
//     public int count() {
//         return children.size();
//     }
// 
//     @Override
//     public List<Node<T, S>> add(Entry<? extends T, ? extends S> entry) {
//         return NonLeafHelper.add(entry, this);
//     }
// 
//     @Override
//     public NodeAndEntries<T, S> delete(Entry<? extends T, ? extends S> entry, boolean all) {
//         return NonLeafHelper.delete(entry, all, this);
//     }
// 
//     @Override
//     public Context<T, S> context() {
//         return context;
//     }
// 
//     @Override
//     public Node<T, S> child(int i) {
//         return children.get(i);
//     }
// 
//     @SuppressWarnings("unchecked")
//     @Override
//     public List<Node<T, S>> children() {
//         return (List<Node<T, S>>) children;
//     }
// }


import java.util.Collections;
import org.junit.Test;
import com.github.davidmoten.rtree.geometry.Geometry;
import com.github.davidmoten.rtree.internal.NonLeafDefault;
package com.github.davidmoten.rtree;




public class NonLeafTest {

    @Test(expected=IllegalArgumentException.class)
    public void testNonLeafPrecondition() {
// Path: src/main/java/com/github/davidmoten/rtree/geometry/Geometry.java
// public interface Geometry {
// 
//     /**
//      * <p>
//      * Returns the distance to the given {@link Rectangle}. For a {@link Rectangle}
//      * this might be Euclidean distance but for an EPSG4326 lat-long Rectangle might
//      * be great-circle distance. The distance function should satisfy the following
//      * properties:
//      * </p>
//      * 
//      * <p>
//      * <code>distance(r) &gt;= 0</code>
//      * </p>
//      * 
//      * <p>
//      * <code>if r1 contains r2 then distance(r1)&lt;=distance(r2)</code>
//      * </p>
//      * 
//      * 
//      * @param r
//      *            rectangle to measure distance to
//      * @return distance to the rectangle r from the geometry
//      */
//     double distance(Rectangle r);
// 
//     /**
//      * Returns the minimum bounding rectangle of this geometry.
//      * 
//      * @return minimum bounding rectangle
//      */
//     Rectangle mbr();
// 
//     boolean intersects(Rectangle r);
// 
//     boolean isDoublePrecision();
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree/internal/NonLeafDefault.java
// public final class NonLeafDefault<T, S extends Geometry> implements NonLeaf<T, S> {
// 
//     private final List<? extends Node<T, S>> children;
//     private final Rectangle mbr;
//     private final Context<T, S> context;
// 
//     public NonLeafDefault(List<? extends Node<T, S>> children, Context<T, S> context) {
//         Preconditions.checkArgument(!children.isEmpty());
//         this.context = context;
//         this.children = children;
//         this.mbr = Util.mbr(children);
//     }
// 
//     @Override
//     public Geometry geometry() {
//         return mbr;
//     }
// 
//     @Override
//     public void searchWithoutBackpressure(Func1<? super Geometry, Boolean> criterion,
//             Subscriber<? super Entry<T, S>> subscriber) {
//         NonLeafHelper.search(criterion, subscriber, this);
//     }
// 
//     @Override
//     public int count() {
//         return children.size();
//     }
// 
//     @Override
//     public List<Node<T, S>> add(Entry<? extends T, ? extends S> entry) {
//         return NonLeafHelper.add(entry, this);
//     }
// 
//     @Override
//     public NodeAndEntries<T, S> delete(Entry<? extends T, ? extends S> entry, boolean all) {
//         return NonLeafHelper.delete(entry, all, this);
//     }
// 
//     @Override
//     public Context<T, S> context() {
//         return context;
//     }
// 
//     @Override
//     public Node<T, S> child(int i) {
//         return children.get(i);
//     }
// 
//     @SuppressWarnings("unchecked")
//     @Override
//     public List<Node<T, S>> children() {
//         return (List<Node<T, S>>) children;
//     }
// }


// Path: src/test/java/com/github/davidmoten/rtree/NonLeafTest.java
import java.util.Collections;
import org.junit.Test;
import com.github.davidmoten.rtree.geometry.Geometry;
import com.github.davidmoten.rtree.internal.NonLeafDefault;

package com.github.davidmoten.rtree;




public class NonLeafTest {

    @Test(expected=IllegalArgumentException.class)
    public void testNonLeafPrecondition() {
        new NonLeafDefault<Object,Geometry>(Collections.<Node<Object,Geometry>>emptyList(), null);