// Path: src/main/java/com/tiemens/secretshare/math/equation/EasyLinearEquation.java
// public static class EasySolve
// {
//     private final BigInteger[] answers;
//     public EasySolve(BigInteger[] inAnswers)
//     {
//         answers = new BigInteger[inAnswers.length];
//         System.arraycopy(inAnswers, 0, answers, 0, answers.length);
//     }
// 
//     public BigInteger getAnswer(int i)
//     {
//         if (i < 0)
//         {
//             throw new SecretShareException("Answer index cannot be negative: " + i);
//         }
//         if (i == 0)
//         {
//             throw new SecretShareException("Answer index 0 is the constant, not an answer." +
//                                            "  Use range 1-n [not 0-n-1]");
//         }
//         return answers[i];
//     }
// 
// }


import org.junit.Test;
import com.tiemens.secretshare.math.equation.EasyLinearEquation.EasySolve;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.math.BigInteger;
import java.util.logging.ConsoleHandler;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.junit.Assert;
/*******************************************************************************
 * Copyright (c) 2009, 2014 Tim Tiemens.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 *
 * Contributors:
 *     Tim Tiemens - initial API and implementation
 *******************************************************************************/
package com.tiemens.secretshare.math.equation;





public class EasyLinearEquationTest
{

    // ==================================================
    // class static data
    // ==================================================

    // ==================================================
    // class static methods
    // ==================================================

    // ==================================================
    // instance data
    // ==================================================

    // ==================================================
    // factories
    // ==================================================

    // ==================================================
    // constructors
    // ==================================================

    // ==================================================
    // public methods
    // ==================================================

    @Test
    public void testFirst()
    {
        EasyLinearEquation ele = null;

        ele = EasyLinearEquation
        .create(new int[][]
                          {
                           { 33, 1,   2,   3},
                           { 81, 4,   5,   6},
                           { 52, 3,   2,   4}
                          });

// Path: src/main/java/com/tiemens/secretshare/math/equation/EasyLinearEquation.java
// public static class EasySolve
// {
//     private final BigInteger[] answers;
//     public EasySolve(BigInteger[] inAnswers)
//     {
//         answers = new BigInteger[inAnswers.length];
//         System.arraycopy(inAnswers, 0, answers, 0, answers.length);
//     }
// 
//     public BigInteger getAnswer(int i)
//     {
//         if (i < 0)
//         {
//             throw new SecretShareException("Answer index cannot be negative: " + i);
//         }
//         if (i == 0)
//         {
//             throw new SecretShareException("Answer index 0 is the constant, not an answer." +
//                                            "  Use range 1-n [not 0-n-1]");
//         }
//         return answers[i];
//     }
// 
// }


// Path: src/test/java/com/tiemens/secretshare/math/equation/EasyLinearEquationTest.java
import org.junit.Test;
import com.tiemens.secretshare.math.equation.EasyLinearEquation.EasySolve;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.math.BigInteger;
import java.util.logging.ConsoleHandler;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.junit.Assert;

/*******************************************************************************
 * Copyright (c) 2009, 2014 Tim Tiemens.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 *
 * Contributors:
 *     Tim Tiemens - initial API and implementation
 *******************************************************************************/
package com.tiemens.secretshare.math.equation;





public class EasyLinearEquationTest
{

    // ==================================================
    // class static data
    // ==================================================

    // ==================================================
    // class static methods
    // ==================================================

    // ==================================================
    // instance data
    // ==================================================

    // ==================================================
    // factories
    // ==================================================

    // ==================================================
    // constructors
    // ==================================================

    // ==================================================
    // public methods
    // ==================================================

    @Test
    public void testFirst()
    {
        EasyLinearEquation ele = null;

        ele = EasyLinearEquation
        .create(new int[][]
                          {
                           { 33, 1,   2,   3},
                           { 81, 4,   5,   6},
                           { 52, 3,   2,   4}
                          });

        EasySolve solve = ele.solve();