// Path: src/main/java/com/github/davidmoten/rtree3d/Entry.java
// public final class Entry<T, S extends Geometry> implements HasGeometry {
//     private final T value;
//     private final S geometry;
// 
//     /**
//      * Constructor.
//      * 
//      * @param value
//      *            the value of the entry
//      * @param geometry
//      *            the geometry of the value
//      */
//     public Entry(T value, S geometry) {
//         Preconditions.checkNotNull(geometry);
//         this.value = value;
//         this.geometry = geometry;
//     }
// 
//     /**
//      * Factory method.
//      * 
//      * @param <T>
//      *            type of value
//      * @param <S>
//      *            type of geometry
//      * @param value
//      *            object being given a spatial context
//      * @param geometry
//      *            geometry associated with the value
//      * @return entry wrapping value and associated geometry
//      */
//     public static <T, S extends Geometry> Entry<T, S> entry(T value, S geometry) {
//         return new Entry<T, S>(value, geometry);
//     }
// 
//     /**
//      * Returns the value wrapped by this {@link Entry}.
//      * 
//      * @return the entry value
//      */
//     public T value() {
//         return value;
//     }
// 
//     @Override
//     public S geometry() {
//         return geometry;
//     }
// 
//     @Override
//     public String toString() {
//         StringBuilder builder = new StringBuilder();
//         builder.append("Entry [value=");
//         builder.append(value);
//         builder.append(", geometry=");
//         builder.append(geometry);
//         builder.append("]");
//         return builder.toString();
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hashCode(value, geometry);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         @SuppressWarnings("rawtypes")
//         Optional<Entry> other = ObjectsHelper.asClass(obj, Entry.class);
//         if (other.isPresent()) {
//             return Objects.equal(value, other.get().value)
//                     && Objects.equal(geometry, other.get().geometry);
//         } else
//             return false;
//     }
// 
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree3d/geometry/Geometries.java
// public final class Geometries {
// 
//     private Geometries() {
//         // prevent instantiation
//     }
// 
//     public static Point point(double x, double y, double z) {
//         return Point.create(x, y, z);
//     }
// 
//     public static Box box(double x1, double y1, double z1, double x2, double y2, double z2) {
//         return Box.create(x1, y1, z1, x2, y2, z2);
//     }
// 
//     public static Box boxGeographic(double lon1, double lat1, double z1, double lon2, double lat2, double z2) {
//         double x1 = normalizeLongitude(lon1);
//         double x2 = normalizeLongitude(lon2);
//         if (x2 < x1) {
//             x2 += 360;
//         }
//         return box(x1, lat1, z1, x2, lat2, z2);
//     }
// 
//     public static Point pointGeographic(double lon, double lat, double z) {
//         return point(normalizeLongitude(lon), lat, z);
//     }
// 
//     @VisibleForTesting
//     static double normalizeLongitude(double d) {
//         if (d == -180.0)
//             return -180.0;
//         else {
//             double sign = Math.signum(d);
//             double x = Math.abs(d) / 360;
//             double x2 = (x - Math.floor(x)) * 360;
//             if (x2 >= 180)
//                 x2 -= 360;
//             return x2 * sign;
//         }
//     }
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import com.github.davidmoten.rtree3d.Entry;
import com.github.davidmoten.rtree3d.geometry.Geometries;
package com.github.davidmoten.rtree3d;




public class EntryTest {

    @Test
    public void testValue() {
        assertEquals(1, (int) Entry.entry(1, Geometries.point(0, 0, 0)).value());
    }

    @Test
    public void testEquality() {
        assertEquals(Entry.entry(1, Geometries.point(0, 0, 0)),
                Entry.entry(1, Geometries.point(0, 0, 0)));
    }

    @Test
    public void testEqualityWithGeometry() {
        assertNotEquals(Entry.entry(1, Geometries.point(0, 0, 0)),
                Entry.entry(1, Geometries.point(0, 1, 0)));
    }

    @Test
    public void testInequality() {
        assertNotEquals(Entry.entry(1, Geometries.point(0, 0, 0)),
                Entry.entry(2, Geometries.point(0, 0, 0)));
    }

    @Test
    public void testInequalityWithNull() {
// Path: src/main/java/com/github/davidmoten/rtree3d/Entry.java
// public final class Entry<T, S extends Geometry> implements HasGeometry {
//     private final T value;
//     private final S geometry;
// 
//     /**
//      * Constructor.
//      * 
//      * @param value
//      *            the value of the entry
//      * @param geometry
//      *            the geometry of the value
//      */
//     public Entry(T value, S geometry) {
//         Preconditions.checkNotNull(geometry);
//         this.value = value;
//         this.geometry = geometry;
//     }
// 
//     /**
//      * Factory method.
//      * 
//      * @param <T>
//      *            type of value
//      * @param <S>
//      *            type of geometry
//      * @param value
//      *            object being given a spatial context
//      * @param geometry
//      *            geometry associated with the value
//      * @return entry wrapping value and associated geometry
//      */
//     public static <T, S extends Geometry> Entry<T, S> entry(T value, S geometry) {
//         return new Entry<T, S>(value, geometry);
//     }
// 
//     /**
//      * Returns the value wrapped by this {@link Entry}.
//      * 
//      * @return the entry value
//      */
//     public T value() {
//         return value;
//     }
// 
//     @Override
//     public S geometry() {
//         return geometry;
//     }
// 
//     @Override
//     public String toString() {
//         StringBuilder builder = new StringBuilder();
//         builder.append("Entry [value=");
//         builder.append(value);
//         builder.append(", geometry=");
//         builder.append(geometry);
//         builder.append("]");
//         return builder.toString();
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hashCode(value, geometry);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         @SuppressWarnings("rawtypes")
//         Optional<Entry> other = ObjectsHelper.asClass(obj, Entry.class);
//         if (other.isPresent()) {
//             return Objects.equal(value, other.get().value)
//                     && Objects.equal(geometry, other.get().geometry);
//         } else
//             return false;
//     }
// 
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree3d/geometry/Geometries.java
// public final class Geometries {
// 
//     private Geometries() {
//         // prevent instantiation
//     }
// 
//     public static Point point(double x, double y, double z) {
//         return Point.create(x, y, z);
//     }
// 
//     public static Box box(double x1, double y1, double z1, double x2, double y2, double z2) {
//         return Box.create(x1, y1, z1, x2, y2, z2);
//     }
// 
//     public static Box boxGeographic(double lon1, double lat1, double z1, double lon2, double lat2, double z2) {
//         double x1 = normalizeLongitude(lon1);
//         double x2 = normalizeLongitude(lon2);
//         if (x2 < x1) {
//             x2 += 360;
//         }
//         return box(x1, lat1, z1, x2, lat2, z2);
//     }
// 
//     public static Point pointGeographic(double lon, double lat, double z) {
//         return point(normalizeLongitude(lon), lat, z);
//     }
// 
//     @VisibleForTesting
//     static double normalizeLongitude(double d) {
//         if (d == -180.0)
//             return -180.0;
//         else {
//             double sign = Math.signum(d);
//             double x = Math.abs(d) / 360;
//             double x2 = (x - Math.floor(x)) * 360;
//             if (x2 >= 180)
//                 x2 -= 360;
//             return x2 * sign;
//         }
//     }
// 
// }


// Path: src/test/java/com/github/davidmoten/rtree3d/EntryTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import com.github.davidmoten.rtree3d.Entry;
import com.github.davidmoten.rtree3d.geometry.Geometries;

package com.github.davidmoten.rtree3d;




public class EntryTest {

    @Test
    public void testValue() {
        assertEquals(1, (int) Entry.entry(1, Geometries.point(0, 0, 0)).value());
    }

    @Test
    public void testEquality() {
        assertEquals(Entry.entry(1, Geometries.point(0, 0, 0)),
                Entry.entry(1, Geometries.point(0, 0, 0)));
    }

    @Test
    public void testEqualityWithGeometry() {
        assertNotEquals(Entry.entry(1, Geometries.point(0, 0, 0)),
                Entry.entry(1, Geometries.point(0, 1, 0)));
    }

    @Test
    public void testInequality() {
        assertNotEquals(Entry.entry(1, Geometries.point(0, 0, 0)),
                Entry.entry(2, Geometries.point(0, 0, 0)));
    }

    @Test
    public void testInequalityWithNull() {
        assertFalse(Entry.entry(1, Geometries.point(0, 0, 0)).equals(null));