text:
/* $Id: JAIMonochromeBitmapConverter.java 738453 2009-01-28 11:10:51Z jeremias $ */

package org.apache.fop.util.bitmap;

import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.IndexColorModel;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.ParameterBlock;

import javax.media.jai.ColorCube;
import javax.media.jai.ImageLayout;
import javax.media.jai.JAI;
import javax.media.jai.KernelJAI;
import javax.media.jai.LookupTableJAI;
import javax.media.jai.PlanarImage;

/**
 * Implementation of the MonochromeBitmapConverter which uses Java Advanced Imaging (JAI)
 * to convert grayscale bitmaps to monochrome bitmaps. JAI provides better dithering options
 * including error diffusion dithering.
 * <p>
 * If you call setHint("quality", "true") on the instance you can enabled error diffusion
 * dithering which produces a nicer result but is also a lot slower.
 */
public class JAIMonochromeBitmapConverter implements
        MonochromeBitmapConverter {

    private boolean isErrorDiffusion = false;

    /** {@inheritDoc} */
    public void setHint(String name, String value) {
        if ("quality".equalsIgnoreCase(name)) {
            isErrorDiffusion = "true".equalsIgnoreCase(value);
        }
    }

    /** {@inheritDoc} */
    public RenderedImage convertToMonochrome(BufferedImage img) {
        return convertToMonochromePlanarImage(img);
    }

    private PlanarImage convertToMonochromePlanarImage(BufferedImage img) {
        if (img.getColorModel().getColorSpace().getNumComponents() != 1) {
            img = BitmapImageUtil.convertToGrayscale(img, null);
        }

        // Load the ParameterBlock for the dithering operation
        // and set the operation name.
        ParameterBlock pb = new ParameterBlock();
        pb.addSource(img);
        String opName = null;
        if (isErrorDiffusion) {
            opName = "errordiffusion";
            LookupTableJAI lut = new LookupTableJAI(new byte[] {(byte)0x00, (byte)0xff});
            pb.add(lut);
            pb.add(KernelJAI.ERROR_FILTER_FLOYD_STEINBERG);
        } else {
            opName = "ordereddither";
            //Create the color cube.
            ColorCube colorMap = ColorCube.createColorCube(DataBuffer.TYPE_BYTE,
                    0, new int[] {2});
            pb.add(colorMap);
            pb.add(KernelJAI.DITHER_MASK_441);
        }

        //Create an image layout for a monochrome b/w image
        ImageLayout layout = new ImageLayout();
        byte[] map = new byte[] {(byte)0x00, (byte)0xff};
        ColorModel cm = new IndexColorModel(1, 2, map, map, map);
        layout.setColorModel(cm);

        // Create a hint containing the layout.
        RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

        // Dither the image.
        PlanarImage dst = JAI.create(opName, pb, hints);

        //Convert it to a BufferedImage
        return dst;
    }

}


text:
use crate::{
    client::AccountAddress,
    crypto::{
        ed25519::{Ed25519PrivateKey, Ed25519PublicKey},
        traits::Uniform,
    },
    transaction_builder::TransactionBuilder,
    types::transaction::{authenticator::AuthenticationKey, RawTransaction, SignedTransaction},
};

pub use diem_types::*;

#[derive(Debug)]
pub struct LocalAccount {
    /// Address of the account.
    address: AccountAddress,
    /// Authentication key of the account.
    key: AccountKey,
    /// Latest known sequence number of the account, it can be different from validator.
    sequence_number: u64,
}

impl LocalAccount {
    pub fn new<T: Into<AccountKey>>(address: AccountAddress, key: T, sequence_number: u64) -> Self {
        Self {
            address,
            key: key.into(),
            sequence_number,
        }
    }

    pub fn generate<R>(rng: &mut R) -> Self
    where
        R: ::rand_core::RngCore + ::rand_core::CryptoRng,
    {
        let key = AccountKey::generate(rng);
        let address = key.authentication_key().derived_address();

        Self::new(address, key, 0)
    }

    pub fn sign_transaction(&self, txn: RawTransaction) -> SignedTransaction {
        txn.sign(self.private_key(), self.public_key().clone())
            .expect("Signing a txn can't fail")
            .into_inner()
    }

    pub fn sign_with_transaction_builder(
        &mut self,
        builder: TransactionBuilder,
    ) -> SignedTransaction {
        let raw_txn = builder
            .sender(self.address())
            .sequence_number(self.sequence_number())
            .build();
        *self.sequence_number_mut() += 1;
        self.sign_transaction(raw_txn)
    }

    pub fn sign_multi_agent_with_transaction_builder(
        &mut self,
        secondary_signers: Vec<&Self>,
        builder: TransactionBuilder,
    ) -> SignedTransaction {
        let secondary_signer_addresses = secondary_signers
            .iter()
            .map(|signer| signer.address())
            .collect();
        let secondary_signer_privkeys = secondary_signers
            .iter()
            .map(|signer| signer.private_key())
            .collect();
        let raw_txn = builder
            .sender(self.address())
            .sequence_number(self.sequence_number())
            .build();
        *self.sequence_number_mut() += 1;
        raw_txn
            .sign_multi_agent(
                self.private_key(),
                secondary_signer_addresses,
                secondary_signer_privkeys,
            )
            .expect("Signing multi agent txn failed")
            .into_inner()
    }

    pub fn address(&self) -> AccountAddress {
        self.address
    }

    pub fn private_key(&self) -> &Ed25519PrivateKey {
        self.key.private_key()
    }

    pub fn public_key(&self) -> &Ed25519PublicKey {
        self.key.public_key()
    }

    pub fn authentication_key(&self) -> AuthenticationKey {
        self.key.authentication_key()
    }

    pub fn sequence_number(&self) -> u64 {
        self.sequence_number
    }

    pub fn sequence_number_mut(&mut self) -> &mut u64 {
        &mut self.sequence_number
    }

    pub fn rotate_key<T: Into<AccountKey>>(&mut self, new_key: T) -> AccountKey {
        std::mem::replace(&mut self.key, new_key.into())
    }
}

#[derive(Debug)]
pub struct AccountKey {
    private_key: Ed25519PrivateKey,
    public_key: Ed25519PublicKey,
    authentication_key: AuthenticationKey,
}

impl AccountKey {
    pub fn generate<R>(rng: &mut R) -> Self
    where
        R: ::rand_core::RngCore + ::rand_core::CryptoRng,
    {
        let private_key = Ed25519PrivateKey::generate(rng);
        Self::from_private_key(private_key)
    }

    pub fn from_private_key(private_key: Ed25519PrivateKey) -> Self {
        let public_key = Ed25519PublicKey::from(&private_key);
        let authentication_key = AuthenticationKey::ed25519(&public_key);

        Self {
            private_key,
            public_key,
            authentication_key,
        }
    }

    pub fn private_key(&self) -> &Ed25519PrivateKey {
        &self.private_key
    }

    pub fn public_key(&self) -> &Ed25519PublicKey {
        &self.public_key
    }

    pub fn authentication_key(&self) -> AuthenticationKey {
        self.authentication_key
    }
}

impl From<Ed25519PrivateKey> for AccountKey {
    fn from(private_key: Ed25519PrivateKey) -> Self {
        Self::from_private_key(private_key)
    }
}

redpajama_set_name: RedPajamaGithub


text:
using BEPUphysics.Entities.Prefabs;
using BEPUutilities;
using BEPUphysics.Entities;
using BEPUphysics.CollisionShapes.ConvexShapes;
using BEPUphysics.BroadPhaseEntries.MobileCollidables;
using System.Collections.Generic;
using BEPUphysics.CollisionShapes;
using BEPUphysics.CollisionRuleManagement;
using BEPUphysics.Materials;

namespace BEPUphysicsDemos.Demos
{
    /// <summary>
    /// Demo showing a variety of alternate ways to construct entities.
    /// </summary>
    public class EntityConstructionDemo : StandardDemo
    {
        /// <summary>
        /// Constructs a new demo.
        /// </summary>
        /// <param name="game">Game owning this demo.</param>
        public EntityConstructionDemo(DemosGame game)
            : base(game)
        {
            //An entity is the basic physical simulation object in BEPUphysics.  It represents a rigid body which can be dynamic or kinematic.
            //Dynamic objects can bounce around and respond to collisions using forces.  Kinematic entities can move using velocity,
            //but effectively have infinite inertia and do not respond to collisions or forces.

            //For each of the below constructors, there are multiple overloads.  Half have a mass parameter, half do not.  If a mass parameter is specified,
            //the object is created as a dynamic object.  If a mass parameter is not specified, it is created as a kinematic object.  This state can be changed later
            //by using the BecomeDynamic/BecomeKinematic methods.

            //************************
            //There are a variety of ways to construct entities depending on your needs.
            //The most common approach is to use the 'prefab' types, like the Box, Sphere, ConvexHull, Cylinder, and so on (BEPUphysics.Entities.Prefabs namespace).
            //These provide a short cut to constructing the objects and generally provide convenience accessors to shape properties.

            //We'll start with such an entity for the kinematic ground.  Notice how it allows the definition of position and shape data all in the constructor.
            //It has other overloads that allow you to specify a mass (for a dynamic object) or a full MotionState instead of just a position.
            Box ground = new Box(new Vector3(0, -.5f, 0), 50, 1, 50);
            Space.Add(ground);

            //If you examine the ground's CollisionInformation property, you'll find that it is a generic method which returns a ConvexCollidable<BoxShape>.
            //So, in addition to having convenience properties, it also lets you go deeper into the object's data by knowing what the types are.

            //************************
            //Let's go one level up the hierarchy to Entity<T>.  This is the superclass of all prefab types.
            //The generic parameter is the type of the Collidable that the entity uses as its collision proxy.
            //It is also what allows prefab types' CollisionInformation property to return that type rather than EntityCollidable.

            Space.Add(new Entity<ConvexCollidable<SphereShape>>(new ConvexCollidable<SphereShape>(new SphereShape(1)), 1)
                          {
                              Position = new Vector3(-10, 1, 0)
                          });

            //That's a bit unwieldy<<>><>, but it works.  Directly constructing entities in this manner isn't common or generally necessary.
            //If you want to have a CollisionInformation property that returns a specific type but don't want to use a specific prefab type, this is the way to go.

            //Note that the constructor itself does not include any position/motion state parameters nor does it include any direct shape data.  The position and other auxiliary
            //properties can be set after it's been constructed.  In this case, object initializer syntax is used to set the Position.
            //The shape data is included within the first EntityCollidable parameter which defines the entity's collision proxy.
            //The prefab types discussed previously all create such EntityCollidables internally using the data passed into the constructor.

            //************************
            //So let's move onto something a little more convenient.  Entity<T> has a non-generic parent Entity.  It still has a CollisionInformation property,
            //but it returns an EntityCollidable rather than a specific type.

            Space.Add(new Entity(new BoxShape(2, 2, 2), 1)
                {
                    Position = new Vector3(10, 1, 0)
                });

            //Much better! No more ugly generic type syntax pollution.  Notice that there are quite a few overloads in the Entity.
            //In addition to overloads that accept EntityCollidable instances (as used in the generic entity above), Entity provides constructors that
            //take shapes directly.  Internally, the entity can create its own EntityCollidable instance based on the shape.  This further simplifies the construction process.

            //An object initializer is once again used to set the position, since the constructors do not have all the convenience constructor frills of the prefab types.

            //************************
            //All of the above entity types have read-only CollisionInformation properties.  Once an entity of those types is created, it cannot change its fundamental shape.
            //A sphere may get bigger or smaller, but a sphere entity couldn't become a box entity.

            //That's where the MorphableEntity comes in.

            var morphable = new MorphableEntity(new CylinderShape(2, 1), 1)
            {
                Position = new Vector3(10, 3, 0)
            };
            Space.Add(morphable);

            //It is constructed identically to its parent Entity class, but after being created, the EntityCollidable it uses can change!
            morphable.CollisionInformation = new ConvexCollidable<ConeShape>(new ConeShape(2, 1));

            //That's neat, but that collidable constructor with generic type is a bit ugly.  We don't care about doing any type-specific configuration
            //on the EntityCollidable itself, so we can just tell the shape to make us an EntityCollidable instance.  This is what the Entity/MorphableEntity constructors
            //do internally when given an EntityShape instead of an EntityCollidable (which in turn contains an EntityShape).
            morphable.CollisionInformation = new ConeShape(2, 1).GetCollidableInstance();

            //While this is arguably a bit prettier, its major benefit comes from the fact that you don't need to know the type of the shape to call GetCollidableInstance.
            //If it's an EntityShape, it can create an EntityCollidable for itself.

            //************************
            //That's it for the different types of entities.  Another very useful technique is to share shapes and initialization between entities.
            //Re-using convex hulls is a common use case.  They have a fairly expensive initialization, and they tend to be some of the larger shapes memory-wise.
            //Rather than having a thousand redundant copies of identical geometry, one shape can be made and reused for subsequent entities.

            //First, create the pointset that composes the convex hull.
            var vertices = new[]
            {
                new Vector3(-1,0,-1),
                new Vector3(-1,0,1),
                new Vector3(1,0,-1),
                new Vector3(1,0,1),
                new Vector3(0,2,0)
            };
            //Construct the shape itself.
            var convexHullShape = new ConvexHullShape(vertices);

            //Create an entity using the shape.
            var convexHull = new Entity(convexHullShape, 2) { Position = new Vector3(0, 1, 0) };
            Space.Add(convexHull);
            //Create a bunch of other shapes using that first shape's properties.
            //Instead of using a first entity's data, this could also be pulled in from some external source (deserialized save data or something).
            for (int i = 1; i <= 10; i++)
            {
                Space.Add(new Entity(convexHullShape, convexHull.Mass, convexHull.LocalInertiaTensor) { Position = new Vector3(0, 1 + i * 3, 0) });
            }

            //In older versions, initializing the entity was a little expensive if the inertia tensor and some other data wasn't provided.
            //These days, the cost is done once in the shape and the entity initialization is pretty much always super cheap.
            //So, you don't need to share inertia tensors for performance reasons.

            //************************
            //All convex shapes are centered on their local origin.  If you create a box entity and assign its position to (0,1,0), the box shape's center will end up at (0,1,0).
            //For simple shapes like the box, that's always the case without doing any work just based on the definition of the shape.

            //More complicated shapes, like the ConvexHullShape, can be constructed from data which is not initially centered around the origin.  For example, consider these vertices:
            vertices = new[]
            {
                new Vector3(-5,15,-1),
                new Vector3(-5,15,1),
                new Vector3(-3,15,-1),
                new Vector3(-3,15,1),
                new Vector3(-4,17,0),
                new Vector3(-4,13,0)
            };
            //The center of those points is obviously going to be very far from the origin.
            //When we construct a ConvexHullShape, the points get 'recentered.'
            convexHullShape = new ConvexHullShape(vertices);

            //If you look at the convexHullShape.Vertices list, you'll see that the points are relative to a local origin now.
            //So now it's centered on the local origin, as was needed.  But there's a problem- what if you wanted your convex hull entity to end up at the original vertex positions?
            //To get it there, we need to know the offset from the original vertices to the local vertices.
            //Fortunately, there is a constructor overload which provides it!
            Vector3 center;
            convexHullShape = new ConvexHullShape(vertices, out center);

            //Now, when the entity is created, we can position it at the original point's center.  The shape still contains local data, but the entity's location ends up putting the shape in the right spot.
            convexHull = new Entity(convexHullShape, 2) { Position = center };
            Space.Add(convexHull);

            //************************
            //Compound bodies are unique in that they allow you to specify groups of shapes to create a concave shape.
            //Here's the common simple approach to making a compound body, using a prefab type for now.
            CompoundBody body = new CompoundBody(new List<CompoundShapeEntry>
            {
                new CompoundShapeEntry(new BoxShape(1, 1, 1), new Vector3(-7, 3, 8), 1),
                new CompoundShapeEntry(new BoxShape(1, 3, 1), new Vector3(-8, 2, 8), 5),
                new CompoundShapeEntry(new BoxShape(1, 1, 1), new Vector3(-9, 1, 8), 1)
            }, 10);
            Space.Add(body);
            //Each entry has a shape, a rigid transform (orientation and/or translation), and a weight.
            //The rigid transform defines the position of the shape in world space.  They will be recentered into local space within the CompoundShape itself (see previous convex hull example).
            //The 'weight' parameter does not correspond directly to mass, but rather to the contribution of that shape to the whole relative to other shapes.
            //It used to compute the center position of the shape.  When used by a dynamic entity, it is also used to compute a proper inertia tensor.  The resulting inertia tensor is scaled by the entity's actual mass.

            //************************
            //Just like shapes can be shared between entities, you can re-use a shape for multiple entries within a compound body.
            var compoundShape = new CompoundShape(new List<CompoundShapeEntry>
            {
                new CompoundShapeEntry(convexHullShape, new Vector3(7, 3, 8), 1),
                new CompoundShapeEntry(convexHullShape, new RigidTransform(new Vector3(8, 2, 8), Quaternion.CreateFromAxisAngle(Vector3.Forward, MathHelper.PiOver2)), 5),
                new CompoundShapeEntry(convexHullShape, new Vector3(9, 1, 8), 1)
            });

            //And just like normal convex shapes can be shared, so can compound shapes!
            for (int i = 0; i < 3; i++)
                Space.Add(new Entity(compoundShape, 10) { Position = new Vector3(8, 10 + i * 4, 8) });

            //************************
            //You can also use compound shapes as subshapes, creating nested compounds.
            Space.Add(new Entity(new CompoundShape(new List<CompoundShapeEntry>
            {
                new CompoundShapeEntry(compoundShape, new Vector3(7, 5, 8), 1),
                new CompoundShapeEntry(compoundShape, new Vector3(9, 1, 8), 1)
            }), 10) { Position = new Vector3(8, 25, 8) });

            //************************
            //Sometimes, it's nice to be able to change how subshapes behave.
            //This example will use a prefab CompoundBody type, but note that there exists a CompoundCollidable that can be constructed independently as well.
            //Just like a list of CompoundShapeEntry objects can be ued to construct a compound object, a list of CompoundChildData objects can too.
            //CompoundChildData objects contain CompoundShapeEntry objects as well as other data to be used by a Collidable instance.
            //That extra data includes material, events, and collision rules.

            var compoundBody = new CompoundBody(new List<CompoundChildData>
            {
                new CompoundChildData { Entry = new CompoundShapeEntry(new CylinderShape(1, 1), new Vector3(0, 2, 8)), CollisionRules = new CollisionRules { Personal = CollisionRule.NoBroadPhase } },
                new CompoundChildData { Entry = new CompoundShapeEntry(new BoxShape(3, 1, 3), new Vector3(0, 1, 8)), Material = new Material(3, 3, 0) }
            }, 10);
            Space.Add(compoundBody);

            //In this example, one of the two blocks doesn't collide with anything.  The other does collide, and has a very high friction material.

            //************************
            //While sharing shapes can help reduce load times, sometimes it's useful to eliminate the shape's initialization cost too.
            //For this purpose, all shapes have a constructor which takes a bunch of data that fully defines the shape.
            //The constructor assumes that all of it is correct; it won't catch any errors or do any additional preprocessing.

            //For example, let's construct a ConvexHullShape from the our earlier ConvexHullShape.
            //We'll need a ConvexShapeDescription that defines the data common to all convex shapes.
            var shapeDescription = new ConvexShapeDescription
                {
                    CollisionMargin = convexHullShape.CollisionMargin,
                    MinimumRadius = convexHullShape.MinimumRadius,
                    MaximumRadius = convexHullShape.MaximumRadius,
                    EntityShapeVolume = new EntityShapeVolumeDescription
                    {
                        Volume = convexHullShape.Volume,
                        VolumeDistribution = convexHullShape.VolumeDistribution
                    }
                };

            //Now, along with the surface vertices from the previous shape, the new shape can be created:
            var shapeFromCachedData = new ConvexHullShape(convexHullShape.Vertices, shapeDescription);

            //Usually, the data for these constructors will come from some cache or storage. For example,
            //a game could store out the above information to disk from a content development tool.
            //At load time, the matching shape can be created at virtually no cost.

            //Stuff the shape into the world!
            Space.Add(new Entity(shapeFromCachedData, 10)
                {
                    Position = new Vector3(-10, 5, -5)
                });

            Game.Camera.Position = new Vector3(0, 3, 25);
        }

        /// <summary>
        /// Gets the name of the simulation.
        /// </summary>
        public override string Name
        {
            get { return "Entity Construction"; }
        }
    }
}


text:
<?php
namespace Aws\Sms;

use Aws\AwsClient;

/**
 * This client is used to interact with the **AWS Server Migration Service** service.
 * @method \Aws\Result createApp(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createAppAsync(array $args = [])
 * @method \Aws\Result createReplicationJob(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createReplicationJobAsync(array $args = [])
 * @method \Aws\Result deleteApp(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteAppAsync(array $args = [])
 * @method \Aws\Result deleteAppLaunchConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteAppLaunchConfigurationAsync(array $args = [])
 * @method \Aws\Result deleteAppReplicationConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteAppReplicationConfigurationAsync(array $args = [])
 * @method \Aws\Result deleteAppValidationConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteAppValidationConfigurationAsync(array $args = [])
 * @method \Aws\Result deleteReplicationJob(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteReplicationJobAsync(array $args = [])
 * @method \Aws\Result deleteServerCatalog(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteServerCatalogAsync(array $args = [])
 * @method \Aws\Result disassociateConnector(array $args = [])
 * @method \GuzzleHttp\Promise\Promise disassociateConnectorAsync(array $args = [])
 * @method \Aws\Result generateChangeSet(array $args = [])
 * @method \GuzzleHttp\Promise\Promise generateChangeSetAsync(array $args = [])
 * @method \Aws\Result generateTemplate(array $args = [])
 * @method \GuzzleHttp\Promise\Promise generateTemplateAsync(array $args = [])
 * @method \Aws\Result getApp(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getAppAsync(array $args = [])
 * @method \Aws\Result getAppLaunchConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getAppLaunchConfigurationAsync(array $args = [])
 * @method \Aws\Result getAppReplicationConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getAppReplicationConfigurationAsync(array $args = [])
 * @method \Aws\Result getAppValidationConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getAppValidationConfigurationAsync(array $args = [])
 * @method \Aws\Result getAppValidationOutput(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getAppValidationOutputAsync(array $args = [])
 * @method \Aws\Result getConnectors(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getConnectorsAsync(array $args = [])
 * @method \Aws\Result getReplicationJobs(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getReplicationJobsAsync(array $args = [])
 * @method \Aws\Result getReplicationRuns(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getReplicationRunsAsync(array $args = [])
 * @method \Aws\Result getServers(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getServersAsync(array $args = [])
 * @method \Aws\Result importAppCatalog(array $args = [])
 * @method \GuzzleHttp\Promise\Promise importAppCatalogAsync(array $args = [])
 * @method \Aws\Result importServerCatalog(array $args = [])
 * @method \GuzzleHttp\Promise\Promise importServerCatalogAsync(array $args = [])
 * @method \Aws\Result launchApp(array $args = [])
 * @method \GuzzleHttp\Promise\Promise launchAppAsync(array $args = [])
 * @method \Aws\Result listApps(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listAppsAsync(array $args = [])
 * @method \Aws\Result notifyAppValidationOutput(array $args = [])
 * @method \GuzzleHttp\Promise\Promise notifyAppValidationOutputAsync(array $args = [])
 * @method \Aws\Result putAppLaunchConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise putAppLaunchConfigurationAsync(array $args = [])
 * @method \Aws\Result putAppReplicationConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise putAppReplicationConfigurationAsync(array $args = [])
 * @method \Aws\Result putAppValidationConfiguration(array $args = [])
 * @method \GuzzleHttp\Promise\Promise putAppValidationConfigurationAsync(array $args = [])
 * @method \Aws\Result startAppReplication(array $args = [])
 * @method \GuzzleHttp\Promise\Promise startAppReplicationAsync(array $args = [])
 * @method \Aws\Result startOnDemandAppReplication(array $args = [])
 * @method \GuzzleHttp\Promise\Promise startOnDemandAppReplicationAsync(array $args = [])
 * @method \Aws\Result startOnDemandReplicationRun(array $args = [])
 * @method \GuzzleHttp\Promise\Promise startOnDemandReplicationRunAsync(array $args = [])
 * @method \Aws\Result stopAppReplication(array $args = [])
 * @method \GuzzleHttp\Promise\Promise stopAppReplicationAsync(array $args = [])
 * @method \Aws\Result terminateApp(array $args = [])
 * @method \GuzzleHttp\Promise\Promise terminateAppAsync(array $args = [])
 * @method \Aws\Result updateApp(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateAppAsync(array $args = [])
 * @method \Aws\Result updateReplicationJob(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateReplicationJobAsync(array $args = [])
 */
class SmsClient extends AwsClient {}


text:
package dynamic

import (
	"fmt"
)

// Config which represents not static but dynamic configuration of cluster-autoscaler which would be updated periodically at runtime
type Config struct {
	Settings
	resourceVersion string
}

// Settings of cluster-autoscaler contained in the latest config, which should be consumed by cluster-autoscaler
type Settings struct {
	NodeGroups []NodeGroupSpec `json:"nodeGroups"`
}

// NewDefaultConfig builds a new config object
func NewDefaultConfig() Config {
	return Config{
		Settings: Settings{
			NodeGroups: []NodeGroupSpec{},
		},
		resourceVersion: "",
	}
}

// NodeGroupSpecStrings returns node group specs represented in the form of `<minSize>:<maxSize>:<name>` to be passed to cloudprovider.
func (c Config) NodeGroupSpecStrings() []string {
	return c.nodeGroupSpecStrings()
}

func (c Config) validate() error {
	for _, g := range c.NodeGroups {
		if err := g.Validate(); err != nil {
			return fmt.Errorf("invalid node group: %v", err)
		}
	}
	return nil
}

func (s Settings) nodeGroupSpecStrings() []string {
	result := []string{}

	for _, spec := range s.NodeGroups {
		result = append(result, spec.String())
	}

	return result
}


text:
                <button type="button" class="navbar-toggle collapsed" ng-click="isNavExpanded = !isNavExpanded">
                    {{'TOGGLE_NAVIGATION' | translate }}

                </button>

                JSON Schema Lint

{{ 'ABOUT' | translate }}

                        <button uib-dropdown-toggle class="btn btn-default dropdown-toggle navbar-btn" type="button" id="sampleDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                             {{ 'SAMPLES' | translate }}

                        </button>

draft-04

v5-unofficial

draft-06

Sample draft-06 schema and valid document

Sample draft-06 schema and invalid document

experimental

Sample experimental schema and valid document

Sample experimental schema and invalid document

                        <button class="btn btn-default btn-danger" ng-click="$ctrl.reset()">
                             {{ 'RESET' | translate }}</button>
                        <button class="btn btn-default" ng-click="$ctrl.saveGist()" ng-disabled="$ctrl.loadedGist || !$ctrl.getSchema() || !$ctrl.getDocument()">
                             {{ 'SAVE_AS_GIST' | translate }}</button>

                            <button uib-dropdown-toggle class="btn btn-default dropdown-toggle" type="button" id="languageDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                 {{ $ctrl.currentMarkup.name || ( 'ERROR_INVALID_MARKUP_BUTTON' | translate )}}

                            </button>

{{ 'MARKUP_LANGUAGE' | translate:$ctrl.currentValidator }}

                                    {{value.name}}

                            <button uib-dropdown-toggle class="btn btn-default dropdown-toggle" type="button" id="specVersionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                 {{ $ctrl.currentValidator.name || ( 'ERROR_INVALID_VERSION_BUTTON' | translate ) }}

                            </button>

{{ 'SPEC_VERSION' | translate:$ctrl.currentValidator }}

                                    {{value.name}}

                <validator identifier="schema" title="{{ 'SCHEMA' | translate }} :: {{$ctrl.currentMarkup.name}}, {{$ctrl.currentValidator.name}}" doc="$ctrl.getSchema()" validate="$ctrl.validateSchema" parse="$ctrl.parseMarkup" pretty-print="$ctrl.prettyPrint" success-message="'SCHEMA_VALID_MESSAGE' | translate:$ctrl.currentValidator" on-update-doc="$ctrl.onUpdateSchemaString(value)" on-update-obj="$ctrl.onUpdateSchemaObj(value)"></validator>

                <validator identifier="document" title="{{ 'DOCUMENT' | translate }} :: {{$ctrl.currentMarkup.name}}" doc="$ctrl.getDocument()" validate="$ctrl.validateDocument" parse="$ctrl.parseMarkup" pretty-print="$ctrl.prettyPrint" success-message="'DOCUMENT_VALID_MESSAGE' | translate:$ctrl.currentValidator" on-update-doc="$ctrl.onUpdateDocumentString(value)" on-update-validity="$ctrl.onUpdateDocumentValidity(value)"></validator>


text:
package org.apache.lucene.codecs.lucene40.values;

import java.io.IOException;

import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.codecs.DocValuesArraySource;
import org.apache.lucene.codecs.lucene40.values.FixedStraightBytesImpl.FixedBytesWriterBase;
import org.apache.lucene.index.DocValues.Source;
import org.apache.lucene.index.DocValues.Type;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.IndexFileNames;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.Counter;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.packed.PackedInts;

/**
 * Stores integers using {@link PackedInts}
 *
 * @lucene.experimental
 * */
class PackedIntValues {

  private static final String CODEC_NAME = "PackedInts";
  private static final byte PACKED = 0x00;
  private static final byte FIXED_64 = 0x01;

  static final int VERSION_START = 0;
  static final int VERSION_CURRENT = VERSION_START;

  static class PackedIntsWriter extends FixedBytesWriterBase {

    private long minValue;
    private long maxValue;
    private boolean started;
    private int lastDocId = -1;

    protected PackedIntsWriter(Directory dir, String id, Counter bytesUsed,
        IOContext context) {
      super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context, Type.VAR_INTS);
      bytesRef = new BytesRef(8);
    }

    @Override
    public void finish(int docCount) throws IOException {
      boolean success = false;
      final IndexOutput dataOut = getOrCreateDataOut();
      try {
        if (!started) {
          minValue = maxValue = 0;
        }
        final long delta = maxValue - minValue;
        // if we exceed the range of positive longs we must switch to fixed
        // ints
        if (delta <= (maxValue >= 0 && minValue <= 0 ? Long.MAX_VALUE
            : Long.MAX_VALUE - 1) && delta >= 0) {
          dataOut.writeByte(PACKED);
          writePackedInts(dataOut, docCount);
          return; // done
        } else {
          dataOut.writeByte(FIXED_64);
        }
        writeData(dataOut);
        writeZeros(docCount - (lastDocID + 1), dataOut);
        success = true;
      } finally {
        resetPool();
        if (success) {
          IOUtils.close(dataOut);
        } else {
          IOUtils.closeWhileHandlingException(dataOut);
        }
      }
    }

    private void writePackedInts(IndexOutput datOut, int docCount) throws IOException {
      datOut.writeLong(minValue);

      // write a default value to recognize docs without a value for that
      // field
      final long defaultValue = maxValue >= 0 && minValue <= 0 ? 0 - minValue
          : ++maxValue - minValue;
      datOut.writeLong(defaultValue);
      PackedInts.Writer w = PackedInts.getWriter(datOut, docCount,
          PackedInts.bitsRequired(maxValue - minValue), PackedInts.DEFAULT);
      for (int i = 0; i < lastDocID + 1; i++) {
        set(bytesRef, i);
        byte[] bytes = bytesRef.bytes;
        int offset = bytesRef.offset;
        long asLong =
           (((long)(bytes[offset+0] & 0xff) << 56) |
            ((long)(bytes[offset+1] & 0xff) << 48) |
            ((long)(bytes[offset+2] & 0xff) << 40) |
            ((long)(bytes[offset+3] & 0xff) << 32) |
            ((long)(bytes[offset+4] & 0xff) << 24) |
            ((long)(bytes[offset+5] & 0xff) << 16) |
            ((long)(bytes[offset+6] & 0xff) <<  8) |
            ((long)(bytes[offset+7] & 0xff)));
        w.add(asLong == 0 ? defaultValue : asLong - minValue);
      }
      for (int i = lastDocID + 1; i < docCount; i++) {
        w.add(defaultValue);
      }
      w.finish();
    }

    @Override
    public void add(int docID, IndexableField docValue) throws IOException {
      final long v = docValue.numericValue().longValue();
      assert lastDocId < docID;
      if (!started) {
        started = true;
        minValue = maxValue = v;
      } else {
        if (v < minValue) {
          minValue = v;
        } else if (v > maxValue) {
          maxValue = v;
        }
      }
      lastDocId = docID;
      DocValuesArraySource.copyLong(bytesRef, v);
      bytesSpareField.setBytesValue(bytesRef);
      super.add(docID, bytesSpareField);
    }
  }

  /**
   * Opens all necessary files, but does not read any data in until you call
   * {@link #load}.
   */
  static class PackedIntsReader extends DocValues {
    private final IndexInput datIn;
    private final byte type;
    private final int numDocs;
    private final DocValuesArraySource values;

    protected PackedIntsReader(Directory dir, String id, int numDocs,
        IOContext context) throws IOException {
      datIn = dir.openInput(
                IndexFileNames.segmentFileName(id, Bytes.DV_SEGMENT_SUFFIX, DocValuesWriterBase.DATA_EXTENSION),
          context);
      this.numDocs = numDocs;
      boolean success = false;
      try {
        CodecUtil.checkHeader(datIn, CODEC_NAME, VERSION_START, VERSION_START);
        type = datIn.readByte();
        values = type == FIXED_64 ?  DocValuesArraySource.forType(Type.FIXED_INTS_64) : null;
        success = true;
      } finally {
        if (!success) {
          IOUtils.closeWhileHandlingException(datIn);
        }
      }
    }

    /**
     * Loads the actual values. You may call this more than once, eg if you
     * already previously loaded but then discarded the Source.
     */
    @Override
    public Source load() throws IOException {
      boolean success = false;
      final Source source;
      IndexInput input = null;
      try {
        input = datIn.clone();

        if (values == null) {
          source = new PackedIntsSource(input, false);
        } else {
          source = values.newFromInput(input, numDocs);
        }
        success = true;
        return source;
      } finally {
        if (!success) {
          IOUtils.closeWhileHandlingException(input, datIn);
        }
      }
    }

    @Override
    public void close() throws IOException {
      super.close();
      datIn.close();
    }

    @Override
    public Type getType() {
      return Type.VAR_INTS;
    }

    @Override
    public Source getDirectSource() throws IOException {
      return values != null ? new FixedStraightBytesImpl.DirectFixedStraightSource(datIn.clone(), 8, Type.FIXED_INTS_64) : new PackedIntsSource(datIn.clone(), true);
    }
  }

  static class PackedIntsSource extends Source {
    private final long minValue;
    private final long defaultValue;
    private final PackedInts.Reader values;

    public PackedIntsSource(IndexInput dataIn, boolean direct) throws IOException {
      super(Type.VAR_INTS);
      minValue = dataIn.readLong();
      defaultValue = dataIn.readLong();
      values = direct ? PackedInts.getDirectReader(dataIn) : PackedInts.getReader(dataIn);
    }

    @Override
    public BytesRef getBytes(int docID, BytesRef ref) {
      ref.grow(8);
      DocValuesArraySource.copyLong(ref, getInt(docID));
      return ref;
    }

    @Override
    public long getInt(int docID) {
      // TODO -- can we somehow avoid 2X method calls
      // on each get? must push minValue down, and make
      // PackedInts implement Ints.Source
      assert docID >= 0;
      final long value = values.get(docID);
      return value == defaultValue ? 0 : minValue + value;
    }
  }

}


text:
// Copyright (C) 2011 - Will Glozer.  All rights reserved.

package com.lambdaworks.redis;

/**
 * Exception thrown when the thread executing a redis command is interrupted.
 *
 * @author Will Glozer
 */
@SuppressWarnings("serial")
public class RedisCommandInterruptedException extends RedisException {

    public RedisCommandInterruptedException(Throwable e) {
        super("Command interrupted", e);
    }
}


text:
- http://dsp.stackexchange.com/questions/3652/fft-pitch-detection-methods-autocorrelation-or-other
- https://github.com/cwilso/PitchDetect


text:
/*--------------------------- Package Declaration ----------------------------*/

package com.github.jessemull.microflex.io.iobiginteger;

import static org.junit.Assert.*;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;

import javax.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import com.github.jessemull.microflex.bigintegerflex.io.PlateReaderBigInteger;
import com.github.jessemull.microflex.bigintegerflex.io.PlateWriterBigInteger;
import com.github.jessemull.microflex.bigintegerflex.plate.PlateBigInteger;
import com.github.jessemull.microflex.bigintegerflex.plate.StackBigInteger;
import com.github.jessemull.microflex.bigintegerflex.plate.WellBigInteger;
import com.github.jessemull.microflex.bigintegerflex.plate.WellSetBigInteger;
import com.github.jessemull.microflex.bigintegerflex.stat.MeanBigInteger;
import com.github.jessemull.microflex.util.RandomUtil;

/*------------------------------- Dependencies -------------------------------*/

/**
 * Tests methods in the plate writer big integer class.
 *
 * @author Jesse L. Mull
 * @update Updated Oct 17, 2016
 * @address http://www.jessemull.com
 * @email hello@jessemull.com
 */
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class PlateWriterBigIntegerTest {

    /* ---------------------------- Local Fields -----------------------------*/

    /* Minimum and maximum values for random well and lists */

	private static BigInteger minValue = new BigInteger(0 + "");                    // Minimum big integer value for wells
	private static BigInteger maxValue = new BigInteger(100 + "");                  // Maximum big integer value for wells
	private static MathContext mc = new MathContext(10, RoundingMode.HALF_DOWN);    // Math context for input values

	/* The addition operation */

	private static MeanBigInteger mean = new MeanBigInteger();

	/* Random objects and numbers for testing */

	private static int rows = PlateBigInteger.ROWS_96WELL;
	private static int columns = PlateBigInteger.COLUMNS_96WELL;
	private static int length = 24;
	private static int plateNumber = 10;
	private static int type = PlateBigInteger.PLATE_96WELL;
	private static int stackNumber = 5;

	private static PlateBigInteger[] array = new PlateBigInteger[plateNumber];
	private static List<Map<WellBigInteger, BigInteger>> maps = new ArrayList<Map<WellBigInteger, BigInteger>>();
	private static List<String> labelList = new ArrayList<String>();
	private static List<StackBigInteger> stacks = new ArrayList<StackBigInteger>();

	private static String path = "test.txt";
	private static File file;
	private static PlateWriterBigInteger plateWriter;
	private static String testLabel = "TestLabel";

    /* Value of false redirects System.err */

	private static boolean error = true;
	private static PrintStream originalOut = System.out;

	/**
	 * Generates random objects and numbers for testing.
	 */
	@BeforeClass
	public static void setUp() {

		if(error) {

			System.setErr(new PrintStream(new OutputStream() {
			    public void write(int x) {}
			}));

		}

		for(int j = 0; j < array.length; j++) {

			String label = "Plate1-" + j;

			PlateBigInteger plate = RandomUtil.randomPlateBigInteger(
					rows, columns, minValue, maxValue, length, label);

			labelList.add(label);
			array[j] = plate;

			Map<WellBigInteger, BigDecimal> toAddBigDecimal = mean.plate(plate, mc);
			TreeMap<WellBigInteger, BigInteger> toAddBigInteger = new TreeMap<WellBigInteger, BigInteger>();

			for(Map.Entry<WellBigInteger, BigDecimal> entry : toAddBigDecimal.entrySet()) {
				toAddBigInteger.put(entry.getKey(), entry.getValue().toBigInteger());
			}

			maps.add(toAddBigInteger);
		}

		for(int k = 0; k < stackNumber; k++) {
			StackBigInteger stack = RandomUtil.randomStackBigInteger(
					rows, columns, minValue, maxValue, length, "Stack" + k, plateNumber);
			stacks.add(stack);
		}
	}

	/**
	 * Creates a file and plate writer.
	 * @throws FileNotFoundException
	 */
	@Before
	public void beforeTests() throws FileNotFoundException {
		file = new File(path);
		plateWriter = new PlateWriterBigInteger(file);
	}

	/**
	 * Deletes the file used in the test.
	 */
	@After
	public void afterTests() {
		file.delete();
	}

	/**
	 * Toggles system error.
	 */
	@AfterClass
	public static void restoreErrorOut() {
		System.setErr(originalOut);
	}

    /*------------------------------ Constructors ----------------------------*/

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     */
	@Test
    public void testConstructorFile() throws FileNotFoundException {

    	PlateWriterBigInteger writer = new PlateWriterBigInteger(file);

    	writer.close();

    	assertFalse(writer == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     * @throws UnsupportedEncodingException
     */
	@Test
    public void testConstructorFileCSN() throws FileNotFoundException, UnsupportedEncodingException {

    	PlateWriterBigInteger writer = new PlateWriterBigInteger(file);

    	writer.close();

    	assertFalse(writer == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     */
	@Test
    public void testConstructorOutputStream() throws FileNotFoundException {

    	FileOutputStream stream = new FileOutputStream(file);
    	PlateWriterBigInteger writer = new PlateWriterBigInteger(stream);

    	writer.close();

    	assertFalse(writer == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     */
	@Test
    public void testConstructorOutputStreamAutoFlush() throws FileNotFoundException {

    	FileOutputStream stream = new FileOutputStream(file);
    	PlateWriterBigInteger writer1 = new PlateWriterBigInteger(stream, true);
    	PlateWriterBigInteger writer2 = new PlateWriterBigInteger(stream, false);

    	writer1.close();
    	writer2.close();

    	assertFalse(writer1 == null);
    	assertFalse(writer2 == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     */
	@Test
    public void testConstructorFileName() throws FileNotFoundException {

    	PlateWriterBigInteger writer = new PlateWriterBigInteger(path);

    	writer.close();

    	assertFalse(writer == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     * @throws UnsupportedEncodingException
     */
	@Test
    public void testConstructorFileNameCSN() throws FileNotFoundException, UnsupportedEncodingException {

    	PlateWriterBigInteger writer = new PlateWriterBigInteger(path, "UTF-8");

    	writer.close();

    	assertFalse(writer == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     */
	@Test
    public void testConstructorWriter() throws FileNotFoundException {

    	PrintWriter inputWriter = new PrintWriter(file);
    	PlateWriterBigInteger writer = new PlateWriterBigInteger(inputWriter);

    	writer.close();

    	assertFalse(writer == null);

    	file.delete();
    }

    /**
     * Tests the plate writer constructor.
     * @throws FileNotFoundException
     */
	@Test
    public void testConstructorWriterAutoFlush() throws FileNotFoundException {

    	PrintWriter inputWriter = new PrintWriter(file);
    	PlateWriterBigInteger writer1 = new PlateWriterBigInteger(inputWriter, true);
    	PlateWriterBigInteger writer2 = new PlateWriterBigInteger(inputWriter, false);

    	writer1.close();
    	writer2.close();

    	assertFalse(writer1 == null);
    	assertFalse(writer2 == null);

    	file.delete();
    }

    /*--------------------- Methods for Plate Map Output ---------------------*/

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
	public void testResultToPlateMapType() throws IOException, JAXBException {

		for(Map<WellBigInteger, BigInteger> map : maps) {
			plateWriter.resultToPlateMap(map, type);
		}

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index++];
			PlateBigInteger output = reader.nextMap();

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
	}

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
    public void testResultToPlateMapListType() throws IOException, JAXBException {

		plateWriter.resultToPlateMap(maps, type);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index++];
			PlateBigInteger output = reader.nextMap();

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
	public void testResultToPlateMapRowsColumns() throws IOException, JAXBException {

		for(Map<WellBigInteger, BigInteger> map : maps) {
			plateWriter.resultToPlateMap(map, rows, columns);
		}

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index++];
			PlateBigInteger output = reader.nextMap();

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
	}

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
    public void testResultToPlateMapListRowsColumns() throws IOException, JAXBException {

    	plateWriter.resultToPlateMap(maps, rows, columns);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index++];
			PlateBigInteger output = reader.nextMap();

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
	public void testResultToPlateMapTypeLabel() throws IOException, JAXBException {

		for(Map<WellBigInteger, BigInteger> map : maps) {
			plateWriter.resultToPlateMap(map, type, testLabel);
		}

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index++];
			PlateBigInteger output = reader.nextMap();

			assertEquals("TestLabel", output.label());

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
	}

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
    public void testResultToPlateMapListTypeLabel() throws IOException, JAXBException {

    	plateWriter.resultToPlateMap(maps, type, labelList);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index];
			PlateBigInteger output = reader.nextMap();

			assertEquals(labelList.get(index++), output.label());

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

	/**
	 * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
	public void testResultToPlateMapRowsColumnsLabel() throws IOException, JAXBException {

		for(Map<WellBigInteger, BigInteger> map : maps) {
			plateWriter.resultToPlateMap(map, rows, columns, testLabel);
		}

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index++];
			PlateBigInteger output = reader.nextMap();

			assertEquals("TestLabel", output.label());

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
	}

	/**
     * Tests the result to plate map method.
	 * @throws JAXBException
	 * @throws IOException
     */
	@Test
    public void testResultToPlateMapListRowsColumnsLabel() throws IOException, JAXBException {

    	plateWriter.resultToPlateMap(maps, rows, columns, labelList);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextMap()) {

			PlateBigInteger input = array[index];
			PlateBigInteger output = reader.nextMap();

			assertEquals(labelList.get(index++), output.label());

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

	/*----------------------- Methods for Table Output -----------------------*/

	/**
     * Tests the result to table method.
	 * @throws JAXBException
	 * @throws IOException
     */
    @Test
    public void testResultToTable() throws IOException, JAXBException {

    	for(Map<WellBigInteger, BigInteger> map : maps) {
			plateWriter.resultToTable(map);
		}

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextTable()) {

			PlateBigInteger input = array[index++];
			WellSetBigInteger output = reader.nextTable();

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

    /**
     * Tests the result to table method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testResultToTableList() throws IOException, JAXBException {

		plateWriter.resultToTable(maps);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextTable()) {

			PlateBigInteger input = array[index++];
			WellSetBigInteger output = reader.nextTable();

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

    /**
     * Tests the result to table method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testResultToTableListLabel() throws IOException, JAXBException {

    	for(Map<WellBigInteger, BigInteger> map : maps) {
			plateWriter.resultToTable(map, testLabel);
		}

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextTable()) {

			PlateBigInteger input = array[index++];
			WellSetBigInteger output = reader.nextTable();

			assertEquals(testLabel, output.label());

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

    /**
     * Tests the result to table method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testResultToTableListLabels() throws IOException, JAXBException {

		plateWriter.resultToTable(maps, labelList);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(file);

		int index = 0;
		while(reader.hasNextTable()) {

			PlateBigInteger input = array[index];
			WellSetBigInteger output = reader.nextTable();

			assertEquals(labelList.get(index++), output.label());

			Iterator<WellBigInteger> iter1 = input.iterator();
			Iterator<WellBigInteger> iter2 = output.iterator();

			while(iter1.hasNext() && iter2.hasNext()) {

				BigInteger inputResult = mean.well(iter1.next(), mc).toBigInteger();
				BigInteger outputResult = iter2.next().data().get(0);

				assertEquals(inputResult, outputResult);
			}
		}

		reader.close();
    }

    /*------------------- Methods for Result JSON Output -------------------*/

    /**
     * Tests the result to JSON method.
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testResultToJSON() throws IOException, JAXBException {

    	String wellPath = "testJSONResult.txt";

    	for(Map<WellBigInteger, BigInteger> map : maps) {

			File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.resultToJSON(map);

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			WellSetBigInteger output = reader.nextJSONResult();
			Iterator<WellBigInteger> iter = output.iterator();

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}

			reader.close();
			wellWriter.close();
			wellFile.delete();

		}
    }

    /**
     * Tests the result to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testResultToJSONList() throws IOException, JAXBException {

    	String wellPath = "testJSONResult.txt";

		File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.resultToJSON(maps);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

		for(Map<WellBigInteger, BigInteger> map : maps) {

			WellSetBigInteger set = reader.nextJSONResult();
			Iterator<WellBigInteger> iter = set.iterator();

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}
		}

		reader.close();
		wellWriter.close();
		wellFile.delete();

    }

    /**
     * Tests the result to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testResultToJSONLabel() throws IOException, JAXBException {

    	String wellPath = "testJSONResult.txt";

    	for(Map<WellBigInteger, BigInteger> map : maps) {

			File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.resultToJSON(map, testLabel);

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			WellSetBigInteger output = reader.nextJSONResult();
			Iterator<WellBigInteger> iter = output.iterator();

			assertEquals(testLabel, output.label());

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}

			reader.close();
			wellWriter.close();
			wellFile.delete();

		}

    }

    /**
     * Tests the result to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testResultToJSONListLabels() throws IOException, JAXBException {

    	String wellPath = "testJSONResult.txt";
    	List<String> labelList = new ArrayList<String>();

    	for(int i = 0; i < maps.size(); i++) {
    		labelList.add("Result" + i);
    	}

    	Iterator<String> labelIter = labelList.iterator();
		File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.resultToJSON(maps, labelList);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

		for(Map<WellBigInteger, BigInteger> map : maps) {

			WellSetBigInteger set = reader.nextJSONResult();
			Iterator<WellBigInteger> iter = set.iterator();
			String inputLabel = labelIter.next();

			assertEquals(inputLabel, set.label());

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}
		}

		reader.close();
		wellWriter.close();
		wellFile.delete();

    }

    /*--------------------- Methods for Well JSON Output ---------------------*/

    /**
     * Tests the well to JSON method.
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testWellToJSON() throws IOException, JAXBException {

    	String wellPath = "testJSONWell.txt";

    	for(PlateBigInteger plate : array) {

    		for(WellBigInteger well : plate) {

    			File wellFile = new File(wellPath);

				PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
    			wellWriter.wellToJSON(well);

    			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
    			WellBigInteger output = reader.nextJSONWell();

    			assertEquals(well, output);
    			assertEquals(well.data(), output.data());

    			reader.close();
    			wellWriter.close();
    			wellFile.delete();
    		}
		}

    }

    /**
     * Tests the well to JSON method.
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testWellToJSONCollection() throws IOException, JAXBException {

    	String wellPath = "testJSONWell.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.wellToJSON(plate.dataSet().allWells());

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    		for(WellBigInteger well : plate) {

    			WellBigInteger output = reader.nextJSONWell();

    			assertEquals(well, output);
    			assertEquals(well.data(), output.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /**
     * Tests the well to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testWellToJSONArray() throws IOException, JAXBException {

    	String wellPath = "testJSONWell.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.wellToJSON(plate.toArray());

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    		for(WellBigInteger well : plate) {

    			WellBigInteger output = reader.nextJSONWell();

    			assertEquals(well, output);
    			assertEquals(well.data(), output.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /*------------------- Methods for Well Set JSON Output -------------------*/

    /**
     * Tests the set to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testSetToJSON() throws IOException, JAXBException {

    	String wellPath = "testJSONSet.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.setToJSON(plate.dataSet());

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			WellSetBigInteger output = reader.nextJSONSet();
			Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /**
     * Tests the set to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testSetToJSONCollection() throws IOException, JAXBException {

    	String wellPath = "testJSONSet.txt";
    	File wellFile = new File(wellPath);

    	List<WellSetBigInteger> collection = new ArrayList<WellSetBigInteger>();

    	for(PlateBigInteger plate : array) {
    		collection.add(plate.dataSet());
    	}

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.setToJSON(collection);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(WellSetBigInteger set : collection) {

    		WellSetBigInteger output = reader.nextJSONSet();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : set) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /**
     * Tests the set to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testSetToJSONArray() throws IOException, JAXBException {

    	String wellPath = "testJSONSet.txt";
    	File wellFile = new File(wellPath);

    	WellSetBigInteger[] sets = new WellSetBigInteger[array.length];

    	for(int i = 0; i < sets.length; i++) {
    		sets[i] = array[i].dataSet();
    	}

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.setToJSON(sets);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(WellSetBigInteger set : sets) {

    		WellSetBigInteger output = reader.nextJSONSet();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : set) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*-------------------- Methods for Plate JSON Output ---------------------*/

    /**
     * Tests the plate to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testPlateToJSONPlate() throws IOException, JAXBException {

    	String wellPath = "testJSONPlate.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.plateToJSON(plate);

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			PlateBigInteger output = reader.nextJSONPlate();
			Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /**
     * Tests the plate to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testPlateToJSONCollection() throws IOException, JAXBException {

    	String wellPath = "testJSONSet.txt";
    	File wellFile = new File(wellPath);

    	List<PlateBigInteger> collection = Arrays.asList(array);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.plateToJSON(collection);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(PlateBigInteger plate : collection) {

    		PlateBigInteger output = reader.nextJSONPlate();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /**
     * Tests the plate to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testPlateToJSONArray() throws IOException, JAXBException {

    	String wellPath = "testJSONSet.txt";
    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.plateToJSON(array);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(PlateBigInteger plate : array) {

    		PlateBigInteger output = reader.nextJSONPlate();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*-------------------- Methods for Stack JSON Output ---------------------*/

    /**
     * Tests the stack to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testStackToJSON() throws IOException, JAXBException {

    	String wellPath = "testJSONPlate.txt";
    	StackBigInteger stack = new StackBigInteger(rows, columns);
    	stack.add(array);

    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.stackToJSON(stack);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
		StackBigInteger output = reader.nextJSONStack();
		Iterator<PlateBigInteger> iterStack = output.iterator();

    	for(PlateBigInteger plate : stack) {

    		PlateBigInteger outputPlate = iterStack.next();
    		Iterator<WellBigInteger> iterPlate = outputPlate.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iterPlate.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /**
     * Tests the stack to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testStackToJSONCollection() throws IOException, JAXBException {

    	String wellPath = "testJSONPlate.txt";
    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.stackToJSON(stacks);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(StackBigInteger stack : stacks) {

    		StackBigInteger output = reader.nextJSONStack();
    		Iterator<PlateBigInteger> iterStack = output.iterator();

    		for(PlateBigInteger plate : stack) {

    			PlateBigInteger outputPlate = iterStack.next();
        		Iterator<WellBigInteger> iterPlate = outputPlate.iterator();

        		for(WellBigInteger well : plate) {

        			WellBigInteger outputWell = iterPlate.next();

        			assertEquals(well, outputWell);
        			assertEquals(well.data(), outputWell.data());
        		}
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();

    }

    /**
     * Tests the stack to JSON method.
     * @throws JAXBException
     * @throws IOException
     */
    @Test
    public void testStackToJSONArray() throws IOException, JAXBException {

    	String wellPath = "testJSONPlate.txt";
    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.stackToJSON(stacks.toArray(new StackBigInteger[stacks.size()]));

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(StackBigInteger stack : stacks) {

    		StackBigInteger output = reader.nextJSONStack();
    		Iterator<PlateBigInteger> iterStack = output.iterator();

    		for(PlateBigInteger plate : stack) {

    			PlateBigInteger outputPlate = iterStack.next();
        		Iterator<WellBigInteger> iterPlate = outputPlate.iterator();

        		for(WellBigInteger well : plate) {

        			WellBigInteger outputWell = iterPlate.next();

        			assertEquals(well, outputWell);
        			assertEquals(well.data(), outputWell.data());
        		}
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*------------------------ Methods for Result XML Output ------------------------*/

    /**
     * Tests the result to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws ParserConfigurationException
     * @throws TransformerException
     */
    @Test
    public void testResultToXML() throws IOException, JAXBException,
    	TransformerException, ParserConfigurationException {

    	String wellPath = "testXMLResults.txt";

    	for(Map<WellBigInteger, BigInteger> map : maps) {

			File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.resultToXML(map);

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			WellSetBigInteger output = reader.nextXMLResult();
			Iterator<WellBigInteger> iter = output.iterator();

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}

			reader.close();
			wellWriter.close();
			wellFile.delete();

		}

    }

    /**
     * Tests the result to XML method.
     * @throws ParserConfigurationException
     * @throws TransformerException
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testResultToXMLList() throws IOException, TransformerException, ParserConfigurationException, JAXBException {

    	String wellPath = "testXMLResults.txt";

		File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.resultToXML(maps);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

		for(Map<WellBigInteger, BigInteger> map : maps) {

			WellSetBigInteger output = reader.nextXMLResult();
			Iterator<WellBigInteger> iter = output.iterator();

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}

		}

		reader.close();
		wellWriter.close();
		wellFile.delete();

    }

    /**
     * Tests the result to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws TransformerException
     * @throws ParserConfigurationException
     */
    @Test
    public void testResultToXMLLabel() throws IOException, JAXBException, ParserConfigurationException, TransformerException {

    	String wellPath = "testXMLResults.txt";

    	for(Map<WellBigInteger, BigInteger> map : maps) {

			File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.resultToXML(map, testLabel);

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			WellSetBigInteger output = reader.nextXMLResult();

			assertEquals(testLabel, output.label());

			Iterator<WellBigInteger> iter = output.iterator();

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}

			reader.close();
			wellWriter.close();
			wellFile.delete();

		}

    }

    /**
     * Tests the result to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws ParserConfigurationException
     * @throws TransformerException
     */
    @Test
    public void testResultToXMLListLabels() throws IOException, JAXBException, TransformerException, ParserConfigurationException {

    	String wellPath = "testXMLResults.txt";

		File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.resultToXML(maps, labelList);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
		Iterator<String> labelIter = labelList.iterator();

		for(Map<WellBigInteger, BigInteger> map : maps) {

			WellSetBigInteger output = reader.nextXMLResult();
			Iterator<WellBigInteger> iter = output.iterator();

			assertEquals(labelIter.next(), output.label());

			for(Map.Entry<WellBigInteger, BigInteger> entry : map.entrySet()) {

				WellBigInteger next = iter.next();

				assertEquals(entry.getKey().index(), next.index());
				assertEquals(entry.getValue(), next.get(0));
			}

		}

		reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*--------------------- Methods for Well XML Output ----------------------*/

    /**
     * Tests the well to XML method.
     * @throws TransformerException
     * @throws ParserConfigurationException
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testWellToXML() throws IOException, ParserConfigurationException, TransformerException, JAXBException {

    	String wellPath = "testXMLWell.txt";

    	for(PlateBigInteger plate : array) {

    		for(WellBigInteger well : plate) {

    			File wellFile = new File(wellPath);

				PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
    			wellWriter.wellToXML(well);

    			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
    			WellBigInteger output = reader.nextXMLWell();

    			assertEquals(well, output);
    			assertEquals(well.data(), output.data());

    			reader.close();
    			wellWriter.close();
    			wellFile.delete();
    		}
		}

    }

    /**
     * Tests the well to XML method.
     * @throws ParserConfigurationException
     * @throws TransformerException
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testWellToXMLCollection() throws IOException, TransformerException, ParserConfigurationException, JAXBException {

    	String wellPath = "testXMLWell.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.wellToXML(plate.dataSet().allWells());

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    		for(WellBigInteger well : plate) {

    			WellBigInteger output = reader.nextXMLWell();

    			assertEquals(well, output);
    			assertEquals(well.data(), output.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /**
     * Tests the well to XML method.
     * @throws TransformerException
     * @throws ParserConfigurationException
     * @throws IOException
     * @throws JAXBException
     */
    @Test
    public void testWellToXMLArray() throws IOException, ParserConfigurationException, TransformerException, JAXBException {

    	String wellPath = "testJSONWell.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.wellToXML(plate.toArray());

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    		for(WellBigInteger well : plate) {

    			WellBigInteger output = reader.nextXMLWell();

    			assertEquals(well, output);
    			assertEquals(well.data(), output.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /*-------------------- Methods for Well Set XML Output --------------------*/

    /**
     * Tests the set to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws TransformerException
     * @throws ParserConfigurationException
     */
    @Test
    public void testSetToXML() throws IOException, JAXBException, ParserConfigurationException, TransformerException {

    	String wellPath = "testXMLSet.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.setToXML(plate.dataSet());

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			WellSetBigInteger output = reader.nextXMLSet();
			Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /**
     * Tests the set to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws ParserConfigurationException
     * @throws TransformerException
     */
    @Test
    public void testSetToXMLCollection() throws IOException, JAXBException, TransformerException, ParserConfigurationException {

    	String wellPath = "testXMLSet.txt";
    	File wellFile = new File(wellPath);

    	List<WellSetBigInteger> collection = new ArrayList<WellSetBigInteger>();

    	for(PlateBigInteger plate : array) {
    		collection.add(plate.dataSet());
    	}

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.setToXML(collection);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(WellSetBigInteger set : collection) {

    		WellSetBigInteger output = reader.nextXMLSet();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : set) {

    			WellBigInteger outputWell = iter.next();
    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /**
     * Tests the set to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws TransformerException
     * @throws ParserConfigurationException
     */
    @Test
    public void testSetToXMLArray() throws IOException, JAXBException, ParserConfigurationException, TransformerException {

    	String wellPath = "testXMLSet.txt";
    	File wellFile = new File(wellPath);

    	WellSetBigInteger[] sets = new WellSetBigInteger[array.length];

    	for(int i = 0; i < sets.length; i++) {
    		sets[i] = array[i].dataSet();
    	}

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.setToXML(sets);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(WellSetBigInteger set : sets) {

    		WellSetBigInteger output = reader.nextXMLSet();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : set) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*-------------------- Methods for Plate XML Output ---------------------*/

    /**
     * Tests the plate to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws ParserConfigurationException
     * @throws TransformerException
     */
    @Test
    public void testPlateToXMLPlate() throws IOException, JAXBException, TransformerException, ParserConfigurationException {

    	String wellPath = "testXMLPlate.txt";

    	for(PlateBigInteger plate : array) {

    		File wellFile = new File(wellPath);

			PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
			wellWriter.plateToXML(plate);

			PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
			PlateBigInteger output = reader.nextXMLPlate();
			Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();
    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

    		reader.close();
			wellWriter.close();
			wellFile.delete();
		}

    }

    /**
     * Tests the plate to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws ParserConfigurationException
     * @throws TransformerException
     */
    @Test
    public void testPlateToXMLCollection() throws IOException, JAXBException, TransformerException, ParserConfigurationException {

    	String wellPath = "testXMLSet.txt";
    	File wellFile = new File(wellPath);

    	List<PlateBigInteger> collection = Arrays.asList(array);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.plateToXML(collection);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(PlateBigInteger plate : collection) {

    		PlateBigInteger output = reader.nextXMLPlate();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /**
     * Tests the plate to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws TransformerException
     * @throws ParserConfigurationException
     */
    @Test
    public void testPlateToXMLArray() throws IOException, JAXBException, ParserConfigurationException, TransformerException {

    	String wellPath = "testXMLSet.txt";
    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.plateToXML(array);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(PlateBigInteger plate : array) {

    		PlateBigInteger output = reader.nextXMLPlate();
    		Iterator<WellBigInteger> iter = output.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iter.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*-------------------- Methods for Stack XML Output ---------------------*/

    /**
     * Tests the stack to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws ParserConfigurationException
     * @throws TransformerException
     */
    @Test
    public void testStackToXML() throws IOException, JAXBException, TransformerException, ParserConfigurationException {

    	String wellPath = "testXMLPlate.txt";
    	StackBigInteger stack = new StackBigInteger(rows, columns);
    	stack.add(array);

    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.stackToXML(stack);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);
		StackBigInteger output = reader.nextXMLStack();
		Iterator<PlateBigInteger> iterStack = output.iterator();

    	for(PlateBigInteger plate : stack) {

    		PlateBigInteger outputPlate = iterStack.next();
    		Iterator<WellBigInteger> iterPlate = outputPlate.iterator();

    		for(WellBigInteger well : plate) {

    			WellBigInteger outputWell = iterPlate.next();

    			assertEquals(well, outputWell);
    			assertEquals(well.data(), outputWell.data());
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /**
     * Tests the stack to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws TransformerException
     * @throws ParserConfigurationException
     */
    @Test
    public void testStackToXMLCollection() throws IOException, JAXBException, ParserConfigurationException, TransformerException {

    	String wellPath = "testXMLPlate.txt";
    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.stackToXML(stacks);

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(StackBigInteger stack : stacks) {

    		StackBigInteger output = reader.nextXMLStack();
    		Iterator<PlateBigInteger> iterStack = output.iterator();

    		for(PlateBigInteger plate : stack) {

    			PlateBigInteger outputPlate = iterStack.next();
        		Iterator<WellBigInteger> iterPlate = outputPlate.iterator();

        		for(WellBigInteger well : plate) {

        			WellBigInteger outputWell = iterPlate.next();

        			assertEquals(well, outputWell);
        			assertEquals(well.data(), outputWell.data());
        		}
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();

    }

    /**
     * Tests the stack to XML method.
     * @throws JAXBException
     * @throws IOException
     * @throws TransformerException
     * @throws ParserConfigurationException
     */
    @Test
    public void testStackToXMLArray() throws IOException, JAXBException, ParserConfigurationException, TransformerException {

    	String wellPath = "testXMLPlate.txt";
    	File wellFile = new File(wellPath);

		PlateWriterBigInteger wellWriter = new PlateWriterBigInteger(wellFile);
		wellWriter.stackToXML(stacks.toArray(new StackBigInteger[stacks.size()]));

		PlateReaderBigInteger reader = new PlateReaderBigInteger(wellFile);

    	for(StackBigInteger stack : stacks) {

    		StackBigInteger output = reader.nextXMLStack();
    		Iterator<PlateBigInteger> iterStack = output.iterator();

    		for(PlateBigInteger plate : stack) {

    			PlateBigInteger outputPlate = iterStack.next();
        		Iterator<WellBigInteger> iterPlate = outputPlate.iterator();

        		for(WellBigInteger well : plate) {

        			WellBigInteger outputWell = iterPlate.next();

        			assertEquals(well, outputWell);
        			assertEquals(well.data(), outputWell.data());
        		}
    		}

		}

    	reader.close();
		wellWriter.close();
		wellFile.delete();
    }

    /*------------ Methods for Setting Print Stream and Delimiter ------------*/

    /**
     * Tests the set and get delimiter methods.
     */
    @Test
    public void testDelimiter() {

    	Random random = new Random();
        String last = "\t";

    	for(int i = 0; i < 100; i++) {
    		String next = "" + ((char) (random.nextInt(126 - 32 + 1) + 32));
    		assertEquals(plateWriter.getDelimiter(), last);
    		plateWriter.setDelimiter(next);
    		assertEquals(plateWriter.getDelimiter(), next);
    		last = next;
    	}

    }

}