text:
package org.arakhne.afc.math.geometry.d3.ai;

import static org.arakhne.afc.math.MathConstants.SHAPE_INTERSECTS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;

import org.junit.Ignore;
import org.junit.Test;

import org.arakhne.afc.math.MathConstants;
import org.arakhne.afc.math.geometry.CrossingComputationType;
import org.arakhne.afc.math.geometry.PathElementType;
import org.arakhne.afc.math.geometry.PathWindingRule;
import org.arakhne.afc.math.geometry.d3.Point3D;
import org.arakhne.afc.math.geometry.d3.Shape3D;
import org.arakhne.afc.math.geometry.d3.Transform3D;

@SuppressWarnings("all")
public abstract class AbstractPath3aiTest<T extends Path3ai<?, T, ?, ?, ?, B>,
		B extends RectangularPrism3ai<?, ?, ?, ?, ?, B>> extends AbstractShape3aiTest<T, B> {

	@Override
	protected final T createShape() {
		T path = (T) createPath();
		path.moveTo(0, 0, 0);
		path.lineTo(2, 2, 0);
		path.quadTo(3, 0, 0, 4, 3, 0);
		path.curveTo(5, -1, 0, 6, 5, 0, 7, -5, 0);
		path.closePath();
		return path;
	}

	@Override
	public void testClone() {
		T clone = this.shape.clone();
		assertNotNull(clone);
		assertNotSame(this.shape, clone);
		assertEquals(this.shape.getClass(), clone.getClass());
		PathIterator3ai pi = clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Override
	public void equalsObject() {
		assertFalse(this.shape.equals(null));
		assertFalse(this.shape.equals(new Object()));
		assertFalse(this.shape.equals(createPath()));
		assertFalse(this.shape.equals(createRectangularPrism(5, 8, 0, 10, 6, 0)));
		assertTrue(this.shape.equals(this.shape));
		Path3ai path = createPath();
		path.moveTo(0, 0, 0);
		path.lineTo(2, 2, 0);
		path.quadTo(3, 0, 0, 4, 3, 0);
		path.curveTo(5, -1, 0, 6, 5, 0, 7, -5, 0);
		path.closePath();
		assertTrue(this.shape.equals(path));
	}

	@Override
	public void equalsObject_withPathIterator() {
		assertFalse(this.shape.equals(createPath().getPathIterator()));
		assertFalse(this.shape.equals(createRectangularPrism(5, 8, 0, 10, 6, 0).getPathIterator()));
		assertTrue(this.shape.equals(this.shape.getPathIterator()));
		Path3ai path = createPath();
		path.moveTo(0, 0, 0);
		path.lineTo(2, 2, 0);
		path.quadTo(3, 0, 0, 4, 3, 0);
		path.curveTo(5, -1, 0, 6, 5, 0, 7, -5, 0);
		path.closePath();
		assertTrue(this.shape.equals(path.getPathIterator()));
	}

	@Override
	public void equalsToShape() {
		assertFalse(this.shape.equalsToShape(null));
		assertFalse(this.shape.equalsToShape((T) createPath()));
		assertTrue(this.shape.equalsToShape(this.shape));
		T path = (T) createPath();
		path.moveTo(0, 0, 0);
		path.lineTo(2, 2, 0);
		path.quadTo(3, 0, 0, 4, 3, 0);
		path.curveTo(5, -1, 0, 6, 5, 0, 7, -5, 0);
		path.closePath();
		assertTrue(this.shape.equalsToShape(path));
	}

	@Override
	public void equalsToPathIterator() {
		assertFalse(this.shape.equalsToPathIterator((PathIterator3ai) null));
		assertFalse(this.shape.equalsToPathIterator(createPath().getPathIterator()));
		assertFalse(this.shape.equalsToPathIterator(createRectangularPrism(5, 8, 0, 10, 6, 0).getPathIterator()));
		assertTrue(this.shape.equalsToPathIterator(this.shape.getPathIterator()));
		Path3ai path = createPath();
		path.moveTo(0, 0, 0);
		path.lineTo(2, 2, 0);
		path.quadTo(3, 0, 0, 4, 3, 0);
		path.curveTo(5, -1, 0, 6, 5, 0, 7, -5, 0);
		path.closePath();
		assertTrue(this.shape.equalsToPathIterator(path.getPathIterator()));
	}

	@Override
	public void isEmpty() {
		assertFalse(this.shape.isEmpty());

		this.shape.clear();
		assertTrue(this.shape.isEmpty());

		this.shape.moveTo(1, 2, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.moveTo(3, 4, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isEmpty());
		this.shape.closePath();
		assertFalse(this.shape.isEmpty());

		this.shape.clear();
		assertTrue(this.shape.isEmpty());

		this.shape.moveTo(1, 2, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.moveTo(3, 4, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.closePath();
		assertTrue(this.shape.isEmpty());

		this.shape.clear();
		assertTrue(this.shape.isEmpty());

		this.shape.moveTo(1, 2, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.moveTo(3, 4, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isEmpty());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isEmpty());
	}

	@Test
	@Override
	public void clear() {
		this.shape.clear();
		assertEquals(0, this.shape.size());
	}

	@Override
	public void getPointIterator() {
		Point3D p;
		Iterator<? extends Point3D> it = this.shape.getPointIterator();

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 0, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 1, p.ix());
		assertEquals(p.toString(), 1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 2, p.ix());
		assertEquals(p.toString(), 2, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 3, p.ix());
		assertEquals(p.toString(), 1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 2, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 3, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 2, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 5, p.ix());
		assertEquals(p.toString(), 2, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 5, p.ix());
		assertEquals(p.toString(), 1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 6, p.ix());
		assertEquals(p.toString(), 1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 6, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 6, p.ix());
		assertEquals(p.toString(), -1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -2, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -3, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -4, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 6, p.ix());
		assertEquals(p.toString(), -4, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 5, p.ix());
		assertEquals(p.toString(), -4, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), -3, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 3, p.ix());
		assertEquals(p.toString(), -2, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 2, p.ix());
		assertEquals(p.toString(), -1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 1, p.ix());
		assertEquals(p.toString(), -1, p.iy());

		assertTrue(it.hasNext());
		p = it.next();
		assertNotNull(p);
		assertEquals(p.toString(), 0, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		assertFalse(it.hasNext());
	}

	@Test
	@Ignore
	public void staticComputeCrossingsFromPoint() {
		assertEquals(0, Path3ai.computeCrossingsFromPoint(0, this.shape.getPathIterator(), -2, 1, 0, null));
		assertEquals(0, Path3ai.computeCrossingsFromPoint(0, this.shape.getPathIterator(), 0, -3, 0, null));
		assertEquals(SHAPE_INTERSECTS,
				Path3ai.computeCrossingsFromPoint(0, this.shape.getPathIterator(), 4, 3, 0, null));
		assertEquals(-2, Path3ai.computeCrossingsFromPoint(0, this.shape.getPathIterator(), 3, 0, 0, null));
	}

	@Test
	@Ignore
	public void staticComputeCrossingsFromRect() {
		assertEquals(0, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				-2, 1, 0, -1, 2, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				0, 1, 0, 3, 6, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 8, 0, 0,
				null));
		assertEquals(-2, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 4, 0, 0,
				null));
		assertEquals(-2, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 5, 0, 0,
				null));
		assertEquals(0, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				0, -4, 0, 3, -3, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				0, -4, 0, 4, -3, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromRect(
				0,
				this.shape.getPathIterator(),
				0, -4, 0, 3, -2, 0,
				null));
	}

	@Test
	@Ignore
	public void staticComputeCrossingsFromSegment() {
		assertEquals(0, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				-2, 1, 0, -1, 2, 0,
				null));
		assertEquals(0, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				0, 1, 0, 3, 6, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 8, 0, 0,
				null));
		assertEquals(-2, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 4, 0, 0,
				null));
		assertEquals(-2, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 5, 0, 0,
				null));
		assertEquals(0, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				0, -4, 0, 3, -3, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				0, -4, 0, 4, -3, 0,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSegment(
				0,
				this.shape.getPathIterator(),
				0, -4, 0, 3, -2, 0,
				null));
	}

	@Test
	@Ignore
	public void staticcomputeCrossingsFromSphere() {
		assertEquals(0, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				-2, 1, 0, 1,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				-2, 1, 0, 2,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				0, 1, 0, 3,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 8,
				null));
		assertEquals(SHAPE_INTERSECTS, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				3, -1, 0, 1,
				null));
		assertEquals(-2, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				4, -1, 0, 0,
				null));
		assertEquals(0, Path3ai.computeCrossingsFromSphere(
				0,
				this.shape.getPathIterator(),
				20, 0, 0, 2,
				null));
	}

	@Test
	@Ignore
	public void staticComputeCrossingsFromPath_notCloseable_noOnlyIntersectWhenOpen() {
		Path3ai path1;
		Path3ai path2;

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertEquals(1, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.STANDARD));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.STANDARD));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.STANDARD));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.STANDARD));
	}

	@Test
	@Ignore
	public void staticComputeCrossingsFromPath_closeable_noOnlyIntersectWhenOpen() {
		Path3ai path1;
		Path3ai path2;

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.AUTO_CLOSE));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
				0,
		        (PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.AUTO_CLOSE));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.AUTO_CLOSE));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.AUTO_CLOSE));
	}

	@Test
	@Ignore
	public void staticComputeCrossingsFromPath_noCloseable_onlyIntersectWhenOpen() {
		Path3ai path1;
		Path3ai path2;

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertEquals(0, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.SIMPLE_INTERSECTION_WHEN_NOT_POLYGON));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.SIMPLE_INTERSECTION_WHEN_NOT_POLYGON));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.SIMPLE_INTERSECTION_WHEN_NOT_POLYGON));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertEquals(MathConstants.SHAPE_INTERSECTS, Path3ai.computeCrossingsFromPath(
		        0,
				(PathIterator3ai) path2.getPathIterator(),
				new BasicPathShadow3ai(path1),
				CrossingComputationType.SIMPLE_INTERSECTION_WHEN_NOT_POLYGON));
	}

	@Test
	@Ignore
	public void staticContainsPathIterator2iIntInt() {
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 0, 0, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 4, 3, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 2, 2, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 2, 1, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 4, 2, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 4, 3, 0));
		assertFalse(Path3ai.contains(this.shape.getPathIterator(), -1, -1, 0));
		assertFalse(Path3ai.contains(this.shape.getPathIterator(), 6, 2, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 3, -2, 0));
		assertFalse(Path3ai.contains(this.shape.getPathIterator(), 2, -2, 0));
	}

	@Test
	@Ignore
	public void staticIntersectsPathIterator2iIntIntIntInt() {
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 0, 0, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 4, 3, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 2, 2, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 2, 1, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 3, 0, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), -1, -1, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 4, -3, 0, 1, 1, 0));
		assertFalse(Path3ai.intersects(this.shape.getPathIterator(), -3, 4, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 6, -5, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 4, 0, 0, 1, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 5, 0, 0, 1, 1, 0));
		assertFalse(Path3ai.intersects(this.shape.getPathIterator(), 0, -3, 0, 1, 1, 0));
		assertFalse(Path3ai.intersects(this.shape.getPathIterator(), 0, -3, 0, 2, 1, 0));
		assertTrue(Path3ai.intersects(this.shape.getPathIterator(), 0, -3, 0, 3, 1, 0));
	}

	@Override
	public void getClosestPointTo() {
		Point3D p;

		p = this.shape.getClosestPointTo(createPoint(0, 0, 0));
		assertEquals(p.toString(), 0, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		// remember: path is closed
		p = this.shape.getClosestPointTo(createPoint(-1, -4, 0));
		assertEquals(p.toString(), 0, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		p = this.shape.getClosestPointTo(createPoint(4, 0, 0));
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		p = this.shape.getClosestPointTo(createPoint(4, 2, 0));
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 2, p.iy());

		p = this.shape.getClosestPointTo(createPoint(4, -1, 0));
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), -1, p.iy());

		p = this.shape.getClosestPointTo(createPoint(2, -3, 0));
		assertEquals(p.toString(), 3, p.ix());
		assertEquals(p.toString(), -2, p.iy());
	}

	@Test
	public void getCurrentX() {
		assertEquals(7, this.shape.getCurrentX());
		this.shape.lineTo(148, 752, 0);
		assertEquals(148, this.shape.getCurrentX());
	}

	@Test
	@Ignore
	public void getCurrentY() {
	    assertEquals(-5, this.shape.getCurrentY());
	    this.shape.lineTo(148, 752, 0);
	    assertEquals(752, this.shape.getCurrentY());
	}

	@Test
	@Ignore
	public void getCurrentZ() {
		assertEquals(-5, this.shape.getCurrentZ());
		this.shape.lineTo(148, 752, 0);
		assertEquals(752, this.shape.getCurrentZ());
	}

	@Test
	public void getCurrentPoint() {
		assertIntPointEquals(7, -5, 0, this.shape.getCurrentPoint());
		this.shape.lineTo(148, 752, 0);
		assertIntPointEquals(148, 752, 0, this.shape.getCurrentPoint());
	}

	@Override
	public void getFarthestPointTo() {
		Point3D p;

		p = this.shape.getFarthestPointTo(createPoint(0, 0, 0));
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		p = this.shape.getFarthestPointTo(createPoint(-1, -4, 0)); // remember: path is closed
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 3, p.iy());

		p = this.shape.getFarthestPointTo(createPoint(4, 0, 0));
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		p = this.shape.getFarthestPointTo(createPoint(4, 2, 0));
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		p = this.shape.getFarthestPointTo(createPoint(4, -1, 0));
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());
	}

	@Override
	public void getDistance() {
		assertEpsilonEquals(0f, this.shape.getDistance(createPoint(0, 0, 0)));
		assertEpsilonEquals(0f, this.shape.getDistance(createPoint(1, 0, 0)));
		assertEpsilonEquals(7.071067812f, this.shape.getDistance(createPoint(-5, -5, 0)));
		assertEpsilonEquals(3f, this.shape.getDistance(createPoint(4, 6, 0)));
		assertEpsilonEquals(1f, this.shape.getDistance(createPoint(7, 0, 0)));
	}

	@Override
	public void getDistanceSquared() {
		assertEpsilonEquals(0f, this.shape.getDistanceSquared(createPoint(0, 0, 0)));
		assertEpsilonEquals(0f, this.shape.getDistanceSquared(createPoint(1, 0, 0)));
		assertEpsilonEquals(50f, this.shape.getDistanceSquared(createPoint(-5, -5, 0)));
		assertEpsilonEquals(9f, this.shape.getDistanceSquared(createPoint(4, 6, 0)));
		assertEpsilonEquals(1f, this.shape.getDistanceSquared(createPoint(7, 0, 0)));
	}

	@Override
	public void getDistanceL1() {
		assertEpsilonEquals(0f, this.shape.getDistanceL1(createPoint(0, 0, 0)));
		assertEpsilonEquals(0f, this.shape.getDistanceL1(createPoint(1, 0, 0)));
		assertEpsilonEquals(10f, this.shape.getDistanceL1(createPoint(-5, -5, 0)));
		assertEpsilonEquals(3f, this.shape.getDistanceL1(createPoint(4, 6, 0)));
		assertEpsilonEquals(1f, this.shape.getDistanceL1(createPoint(7, 0, 0)));
	}

	@Override
	public void getDistanceLinf() {
		assertEpsilonEquals(0f, this.shape.getDistanceLinf(createPoint(0, 0, 0)));
		assertEpsilonEquals(0f, this.shape.getDistanceLinf(createPoint(1, 0, 0)));
		assertEpsilonEquals(5f, this.shape.getDistanceLinf(createPoint(-5, -5, 0)));
		assertEpsilonEquals(3f, this.shape.getDistanceLinf(createPoint(4, 6, 0)));
		assertEpsilonEquals(1f, this.shape.getDistanceLinf(createPoint(7, 0, 0)));
	}

	@Override
	public void translateIntInt() {
		this.shape.translate(3, 4, 0);
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Override
	public void translateVector3D() {
		this.shape.translate(createVector(3, 4, 0));
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Test
	public void setWindingRule() {
		assertEquals(PathWindingRule.NON_ZERO, this.shape.getWindingRule());
		for(PathWindingRule rule : PathWindingRule.values()) {
			this.shape.setWindingRule(rule);
			assertEquals(rule, this.shape.getWindingRule());
		}
	}

	@Test
	@Ignore
	public void addIterator() {
		Path3ai p2 = createPath();
		p2.moveTo(3, 4, 0);
		p2.lineTo(5, 6, 0);

		this.shape.add(p2.getPathIterator());

		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertNoElement(pi);
	}

	@Override
	public void getPathIterator() {
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Override
	public void getPathIteratorTransform3D() {
		Transform3D tr;
		PathIterator3ai pi;

		tr = new Transform3D();
		pi = this.shape.getPathIterator(tr);
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		tr = new Transform3D();
		tr.makeTranslationMatrix(3, 4, 0);
		pi = this.shape.getPathIterator(tr);
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void getPathIteratorDouble() {
		PathIterator3ai pi = this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO);
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.LINE_TO, 3, 1, 0);
		assertElement(pi, PathElementType.LINE_TO, 4, 2, 0);
		assertElement(pi, PathElementType.LINE_TO, 4, 3, 0);
		assertElement(pi, PathElementType.LINE_TO, 4, 2, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 2, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 1, 0);
		assertElement(pi, PathElementType.LINE_TO, 6, 1, 0);
		assertElement(pi, PathElementType.LINE_TO, 6, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 6, -1, 0);
		assertElement(pi, PathElementType.LINE_TO, 7, -1, 0);
		assertElement(pi, PathElementType.LINE_TO, 7, -2, 0);
		assertElement(pi, PathElementType.LINE_TO, 7, -3, 0);
		assertElement(pi, PathElementType.LINE_TO, 7, -4, 0);
		assertElement(pi, PathElementType.LINE_TO, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void transformTransform3D_translation() {
		Transform3D tr = new Transform3D();
		tr.makeTranslationMatrix(3, 4, 0);

		Path3ai clone = this.shape.clone();
		clone.transform(tr);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void createTransformedShape_translation() {
		Transform3D tr = new Transform3D();
		tr.makeTranslationMatrix(3, 4, 0);

		Shape3ai clone = this.shape.createTransformedShape(tr);

		assertTrue(clone instanceof Path3ai);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void transformTransform3D_rotation() {
		Transform3D tr2 = new Transform3D();
		tr2.makeRotationMatrix(-MathConstants.DEMI_PI);

		Path3ai clone = this.shape.clone();
		clone.transform(tr2);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, -2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 0, -3, 0, 3, -4, 0);
		assertElement(pi, PathElementType.CURVE_TO, -1, -5, 0, 5, -6, 0, -5, -7, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void createTransformedShape_rotation() {
		Transform3D tr2 = new Transform3D();
		tr2.makeRotationMatrix(-MathConstants.DEMI_PI);

		Path3ai clone = (Path3ai) this.shape.createTransformedShape(tr2);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, -2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 0, -3, 0, 3, -4, 0);
		assertElement(pi, PathElementType.CURVE_TO, -1, -5, 0, 5, -6, 0, -5, -7, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void transformTransform3D_translationRotation() {
		Transform3D tr = new Transform3D();
		tr.makeTranslationMatrix(3, 4, 0);
		Transform3D tr2 = new Transform3D();
		tr2.makeRotationMatrix(-MathConstants.DEMI_PI);
		Transform3D tr3 = new Transform3D();
		tr3.mul(tr, tr2);

		Path3ai clone = this.shape.clone();
		clone.transform(tr3);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 1, 0, 6, 0, 0);
		assertElement(pi, PathElementType.CURVE_TO, 2, -1, 0, 8, -2, 0, -2, -3, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Override
	public void createTransformedShape() {
		Transform3D tr = new Transform3D();
		tr.makeTranslationMatrix(3, 4, 0);
		Transform3D tr2 = new Transform3D();
		tr2.makeRotationMatrix(-MathConstants.DEMI_PI);
		Transform3D tr3 = new Transform3D();
		tr3.mul(tr, tr2);

		Path3ai clone = (Path3ai) this.shape.createTransformedShape(tr3);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 1, 0, 6, 0, 0);
		assertElement(pi, PathElementType.CURVE_TO, 2, -1, 0, 8, -2, 0, -2, -3, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Override
	public void containsIntInt() {
		assertTrue(this.shape.contains(0, 0, 0));
		assertTrue(this.shape.contains(4, 3, 0));
		assertTrue(this.shape.contains(2, 2, 0));
		assertTrue(this.shape.contains(2, 1, 0));
		assertTrue(this.shape.contains(4, 2, 0));
		assertFalse(this.shape.contains(-1, -1, 0));
		assertFalse(this.shape.contains(6, 2, 0));
		assertTrue(this.shape.contains(3, -2, 0));
		assertFalse(this.shape.contains(2, -2, 0));
	}

	@Override
	public void containsRectangularPrism3ai() {
		assertFalse(this.shape.contains(createRectangularPrism(0, 0, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(4, 3, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(2, 2, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(2, 1, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(3, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.contains(createRectangularPrism(3, 0, 0, 1, 0, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(3, 0, 0, 2, 1, 0)));
		assertTrue(this.shape.contains(createRectangularPrism(3, 0, 0, 2, 0, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(-1, -1, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(4, -3, 0, 1, 1, 0)));
		assertTrue(this.shape.contains(createRectangularPrism(5, -3, 0, 0, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(-3, 4, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(6, -5, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(4, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.contains(createRectangularPrism(4, 0, 0, 1, 0, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(5, 0, 0, 1, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(5, 0, 0, 1, 0, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(5, 0, 0, 0, 1, 0)));
		assertTrue(this.shape.contains(createRectangularPrism(5, 0, 0, 0, 0, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(5, 0, 0, 2, 1, 0)));
		assertFalse(this.shape.contains(createRectangularPrism(6, 0, 0, 1, 1, 0)));
	}

	@Override
	public void intersectsRectangularPrism3ai() {
		assertTrue(this.shape.intersects(createRectangularPrism(0, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(4, 3, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(2, 2, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(2, 1, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(3, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(-1, -1, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(4, -3, 0, 1, 1, 0)));
		assertFalse(this.shape.intersects(createRectangularPrism(-3, 4, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(6, -5, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(4, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createRectangularPrism(5, 0, 0, 1, 1, 0)));
		assertFalse(this.shape.intersects(createRectangularPrism(0, -3, 0, 1, 1, 0)));
		assertFalse(this.shape.intersects(createRectangularPrism(0, -3, 0, 2, 1, 0)));
	}

	@Override
	public void intersectsSphere3ai() {
		assertTrue(this.shape.intersects(createSphere(0, 0, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(4, 3, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(2, 2, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(2, 1, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(3, 0, 0, 1)));
		assertFalse(this.shape.intersects(createSphere(-1, -1, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(4, -3, 0, 1)));
		assertFalse(this.shape.intersects(createSphere(-3, 4, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(6, -5, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(4, 0, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(5, 0, 0, 1)));
		assertTrue(this.shape.intersects(createSphere(6, 2, 0, 1)));
		assertFalse(this.shape.intersects(createSphere(-5, 0, 0, 3)));
	}

	@Override
	public void intersectsSegment3ai() {
		assertTrue(this.shape.intersects(createSegment(0, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(4, 3, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(2, 2, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(2, 1, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(3, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(-1, -1, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(4, -3, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(-3, 4, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(6, -5, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(4, 0, 0, 1, 1, 0)));
		assertTrue(this.shape.intersects(createSegment(5, 0, 0, 1, 1, 0)));
		assertFalse(this.shape.intersects(createSegment(-4, -4, 0, -3, -3, 0)));
		assertFalse(this.shape.intersects(createSegment(-1, 0, 0, 2, 3, 0)));
		assertFalse(this.shape.intersects(createSegment(7, 1, 0, 18, 14, 0)));
	}

	@Override
	public void intersectsPath3ai() {
		Path3ai path1;
		Path3ai path2;

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertFalse(path1.intersects(path2));
		assertFalse(path2.intersects(path1));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertTrue(path1.intersects(path2));
		assertTrue(path2.intersects(path1));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertTrue(path1.intersects(path2));
		assertTrue(path2.intersects(path1));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertTrue(path1.intersects(path2));
		assertTrue(path2.intersects(path1));
	}

	@Override
	public void toBoundingBox() {
		B bb = this.shape.toBoundingBox();
		assertEquals(0, bb.getMinX());
		assertEquals(-5, bb.getMinY());
		assertEquals(7, bb.getMaxX());
		assertEquals(3, bb.getMaxY());
	}

	@Override
	public void toBoundingBoxB() {
		B bb = createRectangularPrism(0, 0, 0, 0, 0, 0);
		this.shape.toBoundingBox(bb);
		assertEquals(0, bb.getMinX());
		assertEquals(-5, bb.getMinY());
		assertEquals(7, bb.getMaxX());
		assertEquals(3, bb.getMaxY());
	}

	@Test
	@Ignore
	public void toBoundingBoxWithCtrlPoints() {
		B bb = this.shape.toBoundingBoxWithCtrlPoints();
		assertEquals(0, bb.getMinX());
		assertEquals(-5, bb.getMinY());
		assertEquals(7, bb.getMaxX());
		assertEquals(5, bb.getMaxY());
	}

	@Test
	@Ignore
	public void removeLast() {
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		this.shape.removeLast();

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertNoElement(pi);

		this.shape.removeLast();

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertNoElement(pi);

		this.shape.removeLast();

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertNoElement(pi);

		this.shape.removeLast();

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertNoElement(pi);

		this.shape.removeLast();

		pi = this.shape.getPathIterator();
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void setLastPointIntInt() {
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		this.shape.setLastPoint(123, 789, 0);

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 123, 789, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void removeIntInt() {
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		this.shape.remove(2, 2, 0);

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 4, 3);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 6, 5, 7, -5);
		assertElement(pi, PathElementType.CLOSE, 0, 0);
		assertNoElement(pi);

		this.shape.remove(4, 3, 0);

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		this.shape.remove(6, 5, 0);

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		this.shape.remove(6, 5, 0);

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Override
	public void containsPoint3D() {
		assertTrue(this.shape.contains(createPoint(0, 0, 0)));
		assertTrue(this.shape.contains(createPoint(4, 3, 0)));
		assertTrue(this.shape.contains(createPoint(2, 2, 0)));
		assertTrue(this.shape.contains(createPoint(2, 1, 0)));
		assertTrue(this.shape.contains(createPoint(4, 2, 0)));
		assertFalse(this.shape.contains(createPoint(-1, -1, 0)));
		assertFalse(this.shape.contains(createPoint(6, 2, 0)));
		assertTrue(this.shape.contains(createPoint(3, -2, 0)));
		assertFalse(this.shape.contains(createPoint(2, -2, 0)));
	}

	@Test
	@Ignore
	public void staticContainsPathIteratorIntInt() {
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 0, 0, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 4, 3, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 2, 2, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 2, 1, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 4, 2, 0));
		assertFalse(Path3ai.contains(this.shape.getPathIterator(), -1, -1, 0));
		assertFalse(Path3ai.contains(this.shape.getPathIterator(), 6, 2, 0));
		assertTrue(Path3ai.contains(this.shape.getPathIterator(), 3, -2, 0));
		assertFalse(Path3ai.contains(this.shape.getPathIterator(), 2, -2, 0));
	}

	@Test
	@Ignore
	public void staticComputeDrawableElementBoundingBox() {
		B box = createRectangularPrism(0, 0, 0, 0, 0, 0);
		assertTrue(Path3ai.computeDrawableElementBoundingBox(this.shape.getPathIterator(), box));
		assertEquals(0, box.getMinX());
		assertEquals(-5, box.getMinY());
		assertEquals(7, box.getMaxX());
		assertEquals(3, box.getMaxY());
	}

	@Test
	@Ignore
	public void staticGetClosestPointTo() {
		Point3D p;

		p = createPoint(0, 0, 0);
		Path3ai.getClosestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 0, 0, 0, p);
		assertEquals(p.toString(), 0, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		p = createPoint(0, 0, 0);
		// remember: path is closed
		Path3ai.getClosestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), -1, -4, 0, p);
		assertEquals(p.toString(), 0, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getClosestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 4, 0, 0, p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 0, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getClosestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 4, 2, 0, p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 2, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getClosestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 4, -1, 0, p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), -1, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getClosestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 2, -3, 0, p);
		assertEquals(p.toString(), 3, p.ix());
		assertEquals(p.toString(), -2, p.iy());
	}

	@Test
	@Ignore
	public void staticGetFarthestPointTo() {
		Point3D p;

		p = createPoint(0, 0, 0);
		Path3ai.getFarthestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 0, 0, 0, p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		p = createPoint(0, 0, 0);
		// remember: path is closed
		Path3ai.getFarthestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), -1, -4, 0, p);
		assertEquals(p.toString(), 4, p.ix());
		assertEquals(p.toString(), 3, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getFarthestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 4, 0, 0, p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getFarthestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 4, 2, 0, p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());

		p = createPoint(0, 0, 0);
		Path3ai.getFarthestPointTo(this.shape.getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO), 4, -1, 0, p);
		assertEquals(p.toString(), 7, p.ix());
		assertEquals(p.toString(), -5, p.iy());
	}

	@Test
	public void moveToIntInt() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(15, 145, 0);

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 15, 145, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(15, 145, 0);
		tmpShape.moveTo(-15, -954, 0);

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, -15, -954, 0);
		assertNoElement(pi);
	}

	@Test
	public void moveToPoint3D() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(createPoint(15, 145, 0));

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 15, 145, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(createPoint(15, 145, 0));
		tmpShape.moveTo(createPoint(-15, -954, 0));

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, -15, -954, 0);
		assertNoElement(pi);
	}

	@Test(expected = IllegalStateException.class)
	public void lineToIntInt_noMoveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.lineTo(15, 145, 0);
	}

	@Test
	@Ignore
	public void lineToIntInt_moveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(15, 145, 0);
		tmpShape.lineTo(189, -45, 0);

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 15, 145, 0);
		assertElement(pi, PathElementType.LINE_TO, 189, -45, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(15, 145, 0);
		tmpShape.lineTo(189, -45, 0);
		tmpShape.lineTo(-5, 0, 0);

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 15, 145, 0);
		assertElement(pi, PathElementType.LINE_TO, 189, -45, 0);
		assertElement(pi, PathElementType.LINE_TO, -5, 0, 0);
		assertNoElement(pi);
	}

	@Test(expected = IllegalStateException.class)
	public void lineToPoint3D_noMoveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.lineTo(createPoint(15, 145, 0));
	}

	@Test
	@Ignore
	public void lineToPoint3D_moveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(15, 145, 0);
		tmpShape.lineTo(createPoint(189, -45, 0));

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 15, 145, 0);
		assertElement(pi, PathElementType.LINE_TO, 189, -45, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(15, 145, 0);
		tmpShape.lineTo(createPoint(189, -45, 0));
		tmpShape.lineTo(createPoint(-5, 0, 0));

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 15, 145, 0);
		assertElement(pi, PathElementType.LINE_TO, 189, -45, 0);
		assertElement(pi, PathElementType.LINE_TO, -5, 0, 0);
		assertNoElement(pi);
	}

	@Test(expected = IllegalStateException.class)
	public void quadToIntIntIntInt_noMoveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.quadTo(15, 145, 0, 50, 20, 0);
	}

	@Test
	@Ignore
	public void quadToIntIntIntInt_moveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.quadTo(15, 145, 0, 50, 20, 0);

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 15, 145, 0, 50, 20, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.quadTo(15, 145, 0, 50, 20, 0);
		tmpShape.quadTo(-42, 0, 0, -47, -60, 0);

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 15, 145, 0, 50, 20, 0);
		assertElement(pi, PathElementType.QUAD_TO, -42, 0, 0, -47, -60, 0);
		assertNoElement(pi);
	}

	@Test(expected = IllegalStateException.class)
	public void quadToPoint3DPoint3D_noMoveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.quadTo(createPoint(15, 145, 0), createPoint(50, 20, 0));
	}

	@Test
	@Ignore
	public void quadToPoint3DPoint3D_moveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.quadTo(createPoint(15, 145, 0), createPoint(50, 20, 0));

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 15, 145, 0, 50, 20, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.quadTo(createPoint(15, 145, 0), createPoint(50, 20, 0));
		tmpShape.quadTo(createPoint(-42, 0, 0), createPoint(-47, -60, 0));

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 15, 145, 0, 50, 20, 0);
		assertElement(pi, PathElementType.QUAD_TO, -42, 0, 0, -47, -60, 0);
		assertNoElement(pi);
	}

	@Test(expected = IllegalStateException.class)
	public void curveToIntIntIntIntIntInt_noMoveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.curveTo(15, 145, 0, 50, 20, 0, 0, 0, 0);
	}

	@Test
	@Ignore
	public void curveToIntIntIntIntIntInt_moveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.curveTo(15, 145, 0, 50, 20, 0, 0, 0, 0);

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.CURVE_TO, 15, 145, 0, 50, 20, 0, 0, 0, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.curveTo(15, 145, 0, 50, 20, 0, 0, 0, 0);
		tmpShape.curveTo(-42, 0, 0, -47, -60, 0, 1, 2, 0);

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.CURVE_TO, 15, 145, 0, 50, 20, 0, 0, 0, 0);
		assertElement(pi, PathElementType.CURVE_TO, -42, 0, 0, -47, -60, 0, 1, 2, 0);
		assertNoElement(pi);
	}

	@Test(expected = IllegalStateException.class)
	public void curveToPoint3DPoint3DPoint3D_noMoveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.curveTo(createPoint(15, 145, 0), createPoint(50, 20, 0), createPoint(0, 0, 0));
	}

	@Test
	@Ignore
	public void curveToPoint3DPoint3DPoint3Dt_moveTo() {
		Path3ai<?, ?, ?, ?, ?, ?> tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.curveTo(createPoint(15, 145, 0), createPoint(50, 20, 0), createPoint(0, 0, 0));

		PathIterator3ai<?> pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.CURVE_TO, 15, 145, 0, 50, 20, 0, 0, 0, 0);
		assertNoElement(pi);

		tmpShape = createPath();
		tmpShape.moveTo(4, 6, 0);
		tmpShape.curveTo(createPoint(15, 145, 0), createPoint(50, 20, 0), createPoint(0, 0, 0));
		tmpShape.curveTo(createPoint(-42, 0, 0), createPoint(-47, -60, 0), createPoint(1, 2, 0));

		pi = tmpShape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 4, 6, 0);
		assertElement(pi, PathElementType.CURVE_TO, 15, 145, 0, 50, 20, 0, 0, 0, 0);
		assertElement(pi, PathElementType.CURVE_TO, -42, 0, 0, -47, -60, 0, 1, 2, 0);
		assertNoElement(pi);
	}

	@Test
	@Ignore
	public void lengthSquared() {
		assertEpsilonEquals(98, this.shape.getLengthSquared());
	}

	@Test
	@Ignore
	public void length() {
		assertEpsilonEquals(9.899494937, this.shape.getLength());
	}

	@Test
	@Ignore
	public void getCoordAt() {
		assertEquals(7, this.shape.size());
		assertEquals(0, this.shape.getCoordAt(0));
		assertEquals(0, this.shape.getCoordAt(1));
		assertEquals(2, this.shape.getCoordAt(2));
		assertEquals(2, this.shape.getCoordAt(3));
		assertEquals(3, this.shape.getCoordAt(4));
		assertEquals(0, this.shape.getCoordAt(5));
		assertEquals(4, this.shape.getCoordAt(6));
		assertEquals(3, this.shape.getCoordAt(7));
		assertEquals(5, this.shape.getCoordAt(8));
		assertEquals(-1, this.shape.getCoordAt(9));
		assertEquals(6, this.shape.getCoordAt(10));
		assertEquals(5, this.shape.getCoordAt(11));
		assertEquals(7, this.shape.getCoordAt(12));
		assertEquals(-5, this.shape.getCoordAt(13));
	}

	@Test
	@Ignore
	public void setLastPointPoint3D() {
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 7, -5, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);

		this.shape.setLastPoint(createPoint(123, 789, 0));

		pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 0, 0, 0);
		assertElement(pi, PathElementType.LINE_TO, 2, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 0, 0, 4, 3, 0);
		assertElement(pi, PathElementType.CURVE_TO, 5, -1, 0, 6, 5, 0, 123, 789, 0);
		assertElement(pi, PathElementType.CLOSE, 0, 0, 0);
		assertNoElement(pi);
	}

	@Test
	public void toCollection() {
		Collection<Point3D> expected = Arrays.asList(
				createPoint(0, 0, 0),
				createPoint(2, 2, 0),
				createPoint(3, 0, 0),
				createPoint(4, 3, 0),
				createPoint(5, -1, 0),
				createPoint(6, 5, 0),
				createPoint(7, -5, 0));
		Collection<?> points = this.shape.toCollection();
		assertCollectionEquals(expected, points);
	}

	@Override
	public void setIT() {
		T newPath = (T) createPath();
		newPath.moveTo(14, -5, 0);
		newPath.lineTo(1, 6, 0);
		newPath.quadTo(-5, 1, 0, 10, -1, 0);
		newPath.curveTo(18, 19, 0, -50, 51, 0, 1, 0, 0);

		this.shape.set(newPath);

		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 14, -5, 0);
		assertElement(pi, PathElementType.LINE_TO, 1, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, -5, 1, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CURVE_TO, 18, 19, 0, -50, 51, 0, 1, 0, 0);
		assertNoElement(pi);
	}

	@Override
	public void intersectsPathIterator3ai() {
		Path3ai path1;
		Path3ai path2;

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertFalse(path1.intersects((PathIterator3ai) path2.getPathIterator()));
		assertFalse(path2.intersects((PathIterator3ai) path1.getPathIterator()));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		assertTrue(path1.intersects((PathIterator3ai) path2.getPathIterator()));
		assertTrue(path2.intersects((PathIterator3ai) path1.getPathIterator()));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertTrue(path1.intersects((PathIterator3ai) path2.getPathIterator()));
		assertTrue(path2.intersects((PathIterator3ai) path1.getPathIterator()));

		path1 = createPath();
		path1.moveTo(-33, 98, 0);
		path1.lineTo(-35, 98, 0);
		path1.lineTo(-35, 101, 0);
		path1.lineTo(-33, 101, 0);
		path1.closePath();
		path2 = createPath();
		path2.moveTo(-33, 99, 0);
		path2.lineTo(-31, 99, 0);
		path2.lineTo(-31, 103, 0);
		path2.lineTo(-34, 103, 0);
		path2.closePath();
		assertTrue(path1.intersects((PathIterator3ai) path2.getPathIterator()));
		assertTrue(path2.intersects((PathIterator3ai) path1.getPathIterator()));
	}

	@Override
	public void intersectsShape3D() {
		assertTrue(this.shape.intersects((Shape3D) createSphere(3, 0, 0, 1)));
		assertTrue(this.shape.intersects((Shape3D) createRectangularPrism(-1, -1, 0, 1, 1, 0)));
	}

	@Override
	public void operator_addVector3D() {
		this.shape.operator_add(createVector(3, 4, 0));
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Override
	public void operator_plusVector3D() {
		T r = this.shape.operator_plus(createVector(3, 4, 0));
		PathIterator3ai pi = r.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 6, 0);
		assertElement(pi, PathElementType.QUAD_TO, 6, 4, 0, 7, 7, 0);
		assertElement(pi, PathElementType.CURVE_TO, 8, 3, 0, 9, 9, 0, 10, -1, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Override
	public void operator_removeVector3D() {
		this.shape.operator_remove(createVector(3, 4, 0));
		PathIterator3ai pi = this.shape.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, -3, -4, 0);
		assertElement(pi, PathElementType.LINE_TO, -1, -2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 0, -4, 0, 1, -1, 0);
		assertElement(pi, PathElementType.CURVE_TO, 2, -5, 0, 3, 1, 0, 4, -9, 0);
		assertElement(pi, PathElementType.CLOSE, -3, -4, 0);
		assertNoElement(pi);
	}

	@Override
	public void operator_minusVector3D() {
		T r = this.shape.operator_minus(createVector(3, 4, 0));
		PathIterator3ai pi = r.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, -3, -4, 0);
		assertElement(pi, PathElementType.LINE_TO, -1, -2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 0, -4, 0, 1, -1, 0);
		assertElement(pi, PathElementType.CURVE_TO, 2, -5, 0, 3, 1, 0, 4, -9, 0);
		assertElement(pi, PathElementType.CLOSE, -3, -4, 0);
		assertNoElement(pi);
	}

	@Override
	public void operator_multiplyTransform3D() {
		Transform3D tr = new Transform3D();
		tr.makeTranslationMatrix(3, 4, 0);
		Transform3D tr2 = new Transform3D();
		tr2.makeRotationMatrix(-MathConstants.DEMI_PI);
		Transform3D tr3 = new Transform3D();
		tr3.mul(tr, tr2);

		Path3ai clone = (Path3ai) this.shape.operator_multiply(tr3);

		PathIterator3ai pi = (PathIterator3ai) clone.getPathIterator();
		assertElement(pi, PathElementType.MOVE_TO, 3, 4, 0);
		assertElement(pi, PathElementType.LINE_TO, 5, 2, 0);
		assertElement(pi, PathElementType.QUAD_TO, 3, 1, 0, 6, 0, 0);
		assertElement(pi, PathElementType.CURVE_TO, 2, -1, 0, 8, -2, 0, -2, -3, 0);
		assertElement(pi, PathElementType.CLOSE, 3, 4, 0);
		assertNoElement(pi);
	}

	@Override
	public void operator_andPoint3D() {
		assertTrue(this.shape.operator_and(createPoint(0, 0, 0)));
		assertTrue(this.shape.operator_and(createPoint(4, 3, 0)));
		assertTrue(this.shape.operator_and(createPoint(2, 2, 0)));
		assertTrue(this.shape.operator_and(createPoint(2, 1, 0)));
		assertTrue(this.shape.operator_and(createPoint(4, 2, 0)));
		assertFalse(this.shape.operator_and(createPoint(-1, -1, 0)));
		assertFalse(this.shape.operator_and(createPoint(6, 2, 0)));
		assertTrue(this.shape.operator_and(createPoint(3, -2, 0)));
		assertFalse(this.shape.operator_and(createPoint(2, -2, 0)));
	}

	@Override
	public void operator_andShape3D() {
		assertTrue(this.shape.operator_and(createSphere(3, 0, 0, 1)));
		assertTrue(this.shape.operator_and(createRectangularPrism(-1, -1, 0, 1, 1, 0)));
	}

	@Override
	public void operator_upToPoint3D() {
		assertEpsilonEquals(0f, this.shape.operator_upTo(createPoint(0, 0, 0)));
		assertEpsilonEquals(0f, this.shape.operator_upTo(createPoint(1, 0, 0)));
		assertEpsilonEquals(7.071067812f, this.shape.operator_upTo(createPoint(-5, -5, 0)));
		assertEpsilonEquals(3f, this.shape.operator_upTo(createPoint(4, 6, 0)));
		assertEpsilonEquals(1f, this.shape.operator_upTo(createPoint(7, 0, 0)));
	}

	@Test
	public void isCurved() {
		assertTrue(this.shape.isCurved());

		this.shape.clear();
		assertFalse(this.shape.isCurved());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isCurved());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isCurved());
		this.shape.closePath();
		assertFalse(this.shape.isCurved());

		this.shape.clear();
		assertFalse(this.shape.isCurved());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isCurved());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.closePath();
		assertFalse(this.shape.isCurved());

		this.shape.clear();
		assertFalse(this.shape.isCurved());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isCurved());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isCurved());
		this.shape.curveTo(7, 8, 0, 9, 10, 0, 11, 12, 0);
		assertTrue(this.shape.isCurved());

		this.shape.clear();
		assertFalse(this.shape.isCurved());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isCurved());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isCurved());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isCurved());
		this.shape.quadTo(7, 8, 0, 9, 10, 0);
		assertTrue(this.shape.isCurved());
	}

	@Test
	@Ignore
	public void isMultiParts() {
		assertFalse(this.shape.isMultiParts());

		this.shape.clear();
		assertFalse(this.shape.isMultiParts());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.closePath();
		assertFalse(this.shape.isMultiParts());

		this.shape.clear();
		assertFalse(this.shape.isMultiParts());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isMultiParts());
		this.shape.curveTo(7, 8, 0, 9, 10, 0, 11, 12, 0);
		assertFalse(this.shape.isMultiParts());

		this.shape.moveTo(1, 2, 0);
		assertTrue(this.shape.isMultiParts());
		this.shape.moveTo(3, 4, 0);
		assertTrue(this.shape.isMultiParts());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isMultiParts());
		this.shape.lineTo(5, 6, 0);
		assertTrue(this.shape.isMultiParts());
		this.shape.quadTo(7, 8, 0, 9, 10, 0);
		assertTrue(this.shape.isMultiParts());
	}

	@Test
	@Ignore
	public void isPolygon() {
		assertTrue(this.shape.isPolygon());

		this.shape.clear();
		assertFalse(this.shape.isPolygon());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.closePath();
		assertTrue(this.shape.isPolygon());

		this.shape.clear();
		assertFalse(this.shape.isPolygon());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.closePath();
		assertTrue(this.shape.isPolygon());

		this.shape.clear();
		assertFalse(this.shape.isPolygon());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.curveTo(7, 8, 0, 9, 10, 0, 11, 12, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.closePath();
		assertTrue(this.shape.isPolygon());

		this.shape.clear();
		assertFalse(this.shape.isPolygon());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.lineTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.lineTo(5, 6, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.quadTo(7, 8, 0, 9, 10, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.closePath();
		assertTrue(this.shape.isPolygon());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolygon());
		this.shape.closePath();
		assertFalse(this.shape.isPolygon());
	}

	@Test
	@Ignore
	public void isPolyline() {
		assertFalse(this.shape.isPolyline());

		this.shape.clear();
		assertFalse(this.shape.isPolyline());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.lineTo(5, 6, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.closePath();
		assertFalse(this.shape.isPolyline());

		this.shape.clear();
		assertFalse(this.shape.isPolyline());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.closePath();
		assertFalse(this.shape.isPolyline());

		this.shape.clear();
		assertFalse(this.shape.isPolygon());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.lineTo(5, 6, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.curveTo(7, 8, 0, 9, 10, 0, 11, 12, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.closePath();
		assertFalse(this.shape.isPolyline());

		this.shape.clear();
		assertFalse(this.shape.isPolyline());

		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.moveTo(3, 4, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.lineTo(5, 6, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.quadTo(7, 8, 0, 9, 10, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.closePath();
		assertFalse(this.shape.isPolyline());

		this.shape.clear();
		assertFalse(this.shape.isPolyline());
		this.shape.moveTo(1, 2, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.lineTo(3, 4, 0);
		assertTrue(this.shape.isPolyline());
		this.shape.moveTo(5, 6, 0);
		assertFalse(this.shape.isPolyline());
		this.shape.lineTo(7, 8, 0);
		assertFalse(this.shape.isPolyline());
	}

}


text:
package com.google.moviestvsentiments.service.database;

import android.os.Process;

import static android.os.Process.THREAD_PRIORITY_BACKGROUND;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

/**
 * An Executor that executes all queries on background threads.
 */
public class AsyncDatabaseExecutor implements Executor {

    private final ExecutorService executor;

    /**
     * Creates an AsyncDatabaseExecutor object.
     */
    private AsyncDatabaseExecutor() {
        executor = Executors.newCachedThreadPool(new ThreadFactory() {
            @Override
            public Thread newThread(Runnable r) {
                Thread thread = new Thread(new Runnable() {
                    @Override
                    public void run() {
                        Process.setThreadPriority(THREAD_PRIORITY_BACKGROUND);
                        r.run();
                    }
                });
                return thread;
            }
        });
    }

    /**
     * Returns a new AsyncDatabaseExecutor.
     */
    public static AsyncDatabaseExecutor create() {
        return new AsyncDatabaseExecutor();
    }

    /**
     * Runs the given Room database queries on a background thread.
     * @param command A runnable that performs the Room database queries.
     */
    @Override
    public void execute(Runnable command) {
        executor.execute(command);
    }
}

redpajama_set_name: RedPajamaGithub


text:
/* */
'use strict';
var EventConstants = require('./EventConstants');
var EventPropagators = require('./EventPropagators');
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var ReactInputSelection = require('./ReactInputSelection');
var SyntheticEvent = require('./SyntheticEvent');
var getActiveElement = require('fbjs/lib/getActiveElement');
var isTextInputElement = require('./isTextInputElement');
var keyOf = require('fbjs/lib/keyOf');
var shallowEqual = require('fbjs/lib/shallowEqual');
var topLevelTypes = EventConstants.topLevelTypes;
var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
var eventTypes = {select: {
    phasedRegistrationNames: {
      bubbled: keyOf({onSelect: null}),
      captured: keyOf({onSelectCapture: null})
    },
    dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
  }};
var activeElement = null;
var activeElementID = null;
var lastSelection = null;
var mouseDown = false;
var hasListener = false;
var ON_SELECT_KEY = keyOf({onSelect: null});
function getSelection(node) {
  if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
    return {
      start: node.selectionStart,
      end: node.selectionEnd
    };
  } else if (window.getSelection) {
    var selection = window.getSelection();
    return {
      anchorNode: selection.anchorNode,
      anchorOffset: selection.anchorOffset,
      focusNode: selection.focusNode,
      focusOffset: selection.focusOffset
    };
  } else if (document.selection) {
    var range = document.selection.createRange();
    return {
      parentElement: range.parentElement(),
      text: range.text,
      top: range.boundingTop,
      left: range.boundingLeft
    };
  }
}
function constructSelectEvent(nativeEvent, nativeEventTarget) {
  if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
    return null;
  }
  var currentSelection = getSelection(activeElement);
  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
    lastSelection = currentSelection;
    var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
    syntheticEvent.type = 'select';
    syntheticEvent.target = activeElement;
    EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
    return syntheticEvent;
  }
  return null;
}
var SelectEventPlugin = {
  eventTypes: eventTypes,
  extractEvents: function(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
    if (!hasListener) {
      return null;
    }
    switch (topLevelType) {
      case topLevelTypes.topFocus:
        if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') {
          activeElement = topLevelTarget;
          activeElementID = topLevelTargetID;
          lastSelection = null;
        }
        break;
      case topLevelTypes.topBlur:
        activeElement = null;
        activeElementID = null;
        lastSelection = null;
        break;
      case topLevelTypes.topMouseDown:
        mouseDown = true;
        break;
      case topLevelTypes.topContextMenu:
      case topLevelTypes.topMouseUp:
        mouseDown = false;
        return constructSelectEvent(nativeEvent, nativeEventTarget);
      case topLevelTypes.topSelectionChange:
        if (skipSelectionChangeEvent) {
          break;
        }
      case topLevelTypes.topKeyDown:
      case topLevelTypes.topKeyUp:
        return constructSelectEvent(nativeEvent, nativeEventTarget);
    }
    return null;
  },
  didPutListener: function(id, registrationName, listener) {
    if (registrationName === ON_SELECT_KEY) {
      hasListener = true;
    }
  }
};
module.exports = SelectEventPlugin;


text:
function varargout = polygonSelfIntersections(poly, varargin)
%POLYGONSELFINTERSECTIONS Find self-intersection points of a polygon.
%
%   PTS = polygonSelfIntersections(POLY)
%   Return the position of self intersection points
%
%   [PTS, POS1, POS2] = polygonSelfIntersections(POLY)
%   Also return the 2 positions of each intersection point (the position
%   when meeting point for first time, then position when meeting point
%   for the second time).
%
%   [...] = polygonSelfIntersections(POLY, 'tolerance', TOL)
%   Specifies an additional parameter to decide whether two intersection
%   points should be considered the same, based on their euclidean
%   distance.
%
%
%   Example
%       % use a '8'-shaped polygon
%       poly = [10 0;0 0;0 10;20 10;20 20;10 20];
%       polygonSelfIntersections(poly)
%       ans =
%           10 10
%
%   See also
%   polygons2d, polylineSelfIntersections
%

% ------
% Author: David Legland
% e-mail: david.legland@nantes.inra.fr
% Created: 2009-06-15,    using Matlab 7.7.0.471 (R2008b)
% Copyright 2009 INRA - Cepia Software Platform.

%   HISTORY
%   2011-06-22 fix bug when removing origin vertex (thanks to Federico
%       Bonelli)

tol = 1e-14;

% parse optional arguments
while length(varargin) > 1
    pname = varargin{1};
    if ~ischar(pname)
        error('Expect optional arguments as name-value pairs');
    end

    if strcmpi(pname, 'tolerance')
        tol = varargin{2};
    else
        error(['Unknown parameter name: ' pname]);
    end
    varargin(1:2) = [];
end

% ensure the last point equals the first one
if sum(abs(poly(end, :)-poly(1,:)) < tol) ~= 2
    poly = [poly; poly(1,:)];
end

% compute intersections by calling algo for polylines
[points, pos1, pos2] = polylineSelfIntersections(poly, 'closed', 'tolerance', tol);

% It may append that first vertex of polygon is detected as intersection,
% the following tries to detect this.
% (pos1 < pos2 by construction)
n = size(poly, 1) - 1;
inds = abs(pos1) < tol & abs(pos2 - n) < tol;
points(inds, :) = [];
pos1(inds)   = [];
pos2(inds)   = [];

%% Post-processing

% process output arguments
if nargout <= 1
    varargout = {points};
elseif nargout == 3
    varargout = {points, pos1, pos2};
end


text:
import logging
import time
from datetime import datetime

# import re
import hashlib

from models import Users, Sessions

from rest_framework.decorators import api_view, renderer_classes
from rest_framework.renderers import JSONRenderer, BrowsableAPIRenderer, status
from rest_framework.response import Response
from vanguard.settings import KEY as SECRET
from cryptography.fernet import Fernet

from utils import validate_token

logger = logging.getLogger('vanguard')

def encrypt(message):
    """encrypts the message"""
    try:
        cipher_suite = Fernet(SECRET)
        cipher_text = cipher_suite.encrypt(bytes(message))
    except Exception as ex:
        logger.debug("encrypt: %s", str(ex))
    return cipher_text

def decrypt(enc_message):
    """decrypts the enc_message"""
    try:
        cipher_suite = Fernet(SECRET)
        plain_text = cipher_suite.decrypt(bytes(enc_message))
    except Exception as ex:
        logger.debug("decrypt: %s", str(ex))
    return plain_text

def sha1hash(message):
    """returns sha1 hash for message"""
    try:
        _sha1 = hashlib.sha1()
        _sha1.update(message)
    except Exception as ex:
        logger.debug("sha1hash: %s", str(ex))
    return _sha1.hexdigest()

@api_view(['GET', 'POST'])
@renderer_classes((JSONRenderer, BrowsableAPIRenderer,))
def user_signup(request):
    """
    Create a new user
    Accepts:
        "email": <string>
        "first_name": <string>
        "last_name": <string>
        "password": <string>
    Returns:
        HTTP_200_OK: if the association is successful
        or
        "error": <string> Exception msg string
    Example POST payload:
    {
        "first_name": "foo",
        "last_name": "bar",
        "email": "foo@bar.com",
        "password": "this_is_secret"
    }
    """
    if request.method == 'POST':
        start_time = time.time()
        if set(['email', 'first_name', 'last_name', 'password']) != set(request.data.keys()):
            return Response({'error': "invalid params"}, status=status.HTTP_400_BAD_REQUEST)
        # if not re.match(r'[^@]+@[^@]+\.[^@]+', request.data['email']):
        #     return Response({'error': "invalid email"}, status=status.HTTP_400_BAD_REQUEST)
        if Users.objects.filter(email__iexact=request.data['email']):
            return Response({'error': "user exists"}, status=status.HTTP_400_BAD_REQUEST)
        try:
            new_user = Users(email=request.data['email'], first_name=request.data['first_name'],
                             last_name=request.data['last_name'], password=encrypt(request.data['password']))
            new_user.save()
            logger.debug("user_signup: elapsed time: %s" % (time.time() - start_time))
            return Response(status=status.HTTP_200_OK)
        except Exception as ex:
            str_ex = str(ex)
            logger.debug(("user_signup: %s", str_ex))
            logger.debug("user_signup: elapsed time: %s" % (time.time() - start_time))
            return Response({'error': str_ex}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
    elif request.method == 'GET':
        err_dict = {
            'error': 'invalid request',
            'example POST payload': {
                "first_name": "foo",
                "last_name": "bar",
                "email": "foo@bar.com",
                "password": "this_is_secret"
            }
        }
        return Response(err_dict, status=status.HTTP_400_BAD_REQUEST)

@api_view(['POST'])
@renderer_classes((JSONRenderer, BrowsableAPIRenderer,))
def user_login(request):
    """
    Authenticates a user
    Accepts:
        "email": <string>
        "password": <string>
    Returns:
        "token": if the credentials are valid; this key has to be used in HTTP headers for accessing
               any of the backend APIs
        "email": email of the authenticated user
        "first_name": <string>
        "last_name": <string>
        or
        "error": <string> Exception msg string
    Example POST payload:
    {
        "email": "foo@bar.com",
        "password": "this_is_secret"
    }
    """
    if request.method == 'POST':
        start_time = time.time()
        if set(['email', 'password']) != set(request.data.keys()):
            return Response({'error': "invalid params"}, status=status.HTTP_400_BAD_REQUEST)
        try:
            user = Users.objects.filter(email__iexact=request.data['email'])
        except Exception as ex:
            logger.debug("user_login: %s", str(ex))
        if user:
            # since user_signup ensures that there will always be one user, let's pluck the first
            user = user.first()
            if decrypt(user.password) == str(request.data['password']):
                old_session = Sessions.objects.filter(user_id__exact=user.id)
                if old_session:
                    old_session.update(last_used=datetime.now())
                    old_session = old_session.first()
                    logger.debug("user_login: elapsed time: %s" % (time.time() - start_time))
                    return Response({'token': old_session.key,
                                     'email': user.email,
                                     'first_name': user.first_name,
                                     'last_name': user.last_name}, status=status.HTTP_200_OK)
                else:
                    new_session = Sessions(user=user, last_used=datetime.now(), key=sha1hash(request.data['email'] +
                                                                                request.data['password'] +
                                                                                SECRET))
                    new_session.save()
                    logger.debug("user_login: elapsed time: %s" % (time.time() - start_time))
                    return Response({'token': new_session.key,
                                     'email': user.email,
                                     'first_name': user.first_name,
                                     'last_name': user.last_name}, status=status.HTTP_200_OK)
            else:
                logger.debug("user_login: invalid password for %s", request.data['email'])
                return Response({'error': 'invalid password'}, status=status.HTTP_400_BAD_REQUEST)
        else:
            logger.debug("user_login: invalid email %s", request.data['email'])
            return Response({'error': 'invalid email'}, status=status.HTTP_400_BAD_REQUEST)

@api_view(['POST'])
@renderer_classes((JSONRenderer, BrowsableAPIRenderer,))
@validate_token
def forgot_password(request):
    # TBD
    pass

@api_view(['POST'])
@renderer_classes((JSONRenderer, BrowsableAPIRenderer,))
@validate_token
def user_logout(request):
    """
    Accepts:
        "token" HTTP header
    Returns:
        HTTP_200_OK: if the logout is successful
        HTTP_500_INTERNAL_SERVER_ERROR: in bizarre situations
    """
    user_email = request.META['HTTP_TOKEN']
    user = Users.objects.filter(email__iexact=user_email).first()
    try:
        Sessions.objects.filter(user_id__exact=user.id).delete()
        return Response({'info': "logout success!"}, status=status.HTTP_200_OK)
    except Exception as ex:
        logger.debug("user_logout: %s", str(ex))
        return Response({'error': "something went wrong!"}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)


text:
module Refactor
  class MoveClass < BaseRefactor

    def run
      @first_klasses.each do |klass_v1|
        @second_klasses.each do |klass_v2|
          if filter klass_v1, klass_v2
            puts "Refactor MoveClass #{klass_v1.name} to #{klass_v2.name}"
            @counter+=1
          end
        end
      end
    end

    private

    def filter klass_v1, klass_v2
      return same_class(klass_v1,klass_v2) && klass_v1.parent != klass_v2.parent
    end

    def same_class klass_v1, klass_v2
      klass_v1.methods == klass_v2.methods && klass_v1.attributes == klass_v2.attributes && klass_v1.name_klass == klass_v2.name_klass
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SeeThirtyTest.Controllers
{
    public class WebSocketTestController : Controller
    {
        // GET: WebSocketTest
        public ActionResult Index()
        {
            return View();
        }
    }
}


text:
namespace Kioto::Renderer
{
class Shader : public Asset
{
public:
    Shader() : Asset("") {}
    Shader(const std::string& path) : Asset(path)
    {
    }

    void SetHandle(ShaderHandle handle);
    ShaderHandle GetHandle() const;

    const ShaderData& GetShaderData() const;
    void SetShaderData(const ShaderData& data);

    const RenderObjectBufferLayout& GetBufferLayoutTemplate() const;
    void SetBufferLayoutTemplate(const RenderObjectBufferLayout& layoutTemplate);
    const RenderObjectConstants& GetRenderObjectConstants() const;
    void SetRenderObjectConstants(const RenderObjectConstants& roConstants);

    RenderObjectBufferLayout CreateLayoutTemplateShalowCopy() const;

private:
    ShaderProgramHandle m_vsHandle;
    ShaderProgramHandle m_psHandle;
    VertexLayoutHandle m_vertexLayout;
    ShaderData m_data;
    RenderObjectBufferLayout m_bufferLayoutTemplate;
    RenderObjectConstants m_rootConstants;

    ShaderHandle m_handle; // [a_vorontcov] Separate handles for each define set?

    friend class Material;
};

inline void Shader::SetHandle(ShaderHandle handle)
{
    m_handle = handle;
}

inline ShaderHandle Shader::GetHandle() const
{
    return m_handle;
}

inline void Shader::SetShaderData(const ShaderData& data)
{
    m_data = data;
}

inline const ShaderData& Shader::GetShaderData() const
{
    return m_data;
}

inline const RenderObjectBufferLayout& Shader::GetBufferLayoutTemplate() const
{
    return m_bufferLayoutTemplate;
}

inline void Shader::SetBufferLayoutTemplate(const RenderObjectBufferLayout& layoutTemplate)
{
    m_bufferLayoutTemplate = layoutTemplate;
}

inline RenderObjectBufferLayout Shader::CreateLayoutTemplateShalowCopy() const
{
    RenderObjectBufferLayout res;
    res.resize(m_bufferLayoutTemplate.size());
    for (size_t i = 0; i < m_bufferLayoutTemplate.size(); ++i)
        m_bufferLayoutTemplate[i].MakeShallowCopy(res[i]);
    return res;
}

inline const RenderObjectConstants& Shader::GetRenderObjectConstants() const
{
    return m_rootConstants;
}

inline void Shader::SetRenderObjectConstants(const RenderObjectConstants& roConstants)
{
    m_rootConstants = roConstants;
}

}


text:
@interface FSWebViewController () <UIWebViewDelegate>

@property (nonatomic, strong) UIWebView  *webView;
@property (nonatomic, copy)   NSURL      *URL;

- (void)loadData;
- (void)openURLInSafari;

@end

@implementation FSWebViewController

- (id)init
{
    self = [super init];
    if (self)
    {
        self.title = @"Webpage";
    }
    return self;
}

+ (FSWebViewController *)webViewControllerWithURL:(NSURL *)URL
{
    FSWebViewController *viewController = [[FSWebViewController alloc] init];
    if (viewController)
    {
        viewController.URL = URL;
    }
    return viewController;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    [_webView stopLoading];
}

- (void)viewDidLoad
{
    [super viewDidLoad];

	self.webView = [[UIWebView alloc] initWithFrame:self.contentView.bounds];
    _webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    _webView.backgroundColor  = FS_COLOR_BACKGROUND;
    _webView.delegate         = self;
    _webView.scalesPageToFit  = YES;
    [self.view addSubview:_webView];

    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(openURLInSafari)];

    [self loadData];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Web view delegate

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self showLoadingIndicator:NO];
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    [self showLoadingIndicator:NO];

    if (error.code != NSURLErrorCancelled)
    {
        [self.webView loadHTMLString:error.localizedDescription baseURL:nil];
    }
}

#pragma mark - Private methods

- (void)loadData
{
    if (_URL)
    {
        [self showLoadingIndicator:YES];

        NSURLRequest *request = [NSURLRequest requestWithURL:_URL];
        [_webView loadRequest:request];
    }
    else
    {
        DLog(@"WARNING: no URL in news item");
    }
}

- (void)openURLInSafari
{
    if ([[UIApplication sharedApplication] canOpenURL:_newsItem.URL])
    {
        [[UIApplication sharedApplication] openURL:_newsItem.URL];
    }
    else
    {
        DLog(@"WARNING: can't open URL: %@", _newsItem.URL);
    }
}

@end