try {
                closeable.close();
            } catch (IOException e) {
                // Eat
            }

package mil.nga.geopackage.tiles;

import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.util.Iterator;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
import mil.nga.geopackage.GeoPackageException;

/**
 * Image utility methods
 *
 * @author osbornb
 */
public class ImageUtils {

    /**
     * png image format
     */
    public static final String IMAGE_FORMAT_PNG = "png";

    /**
     * jpg image format
     */
    public static final String IMAGE_FORMAT_JPG = "jpg";

    /**
     * jpeg image format
     */
    public static final String IMAGE_FORMAT_JPEG = "jpeg";

    public static final String IMAGE_FORMAT_TIFF = "tiff";

    /**
     * Create a buffered image for the dimensions and image format
     *
     * @param width
     *            image width
     * @param height
     *            image height
     * @param imageFormat
     *            image format
     * @return image
     */
    public static BufferedImage createBufferedImage(int width, int height, String imageFormat) {
        int imageType;
        switch(imageFormat.toLowerCase()) {
            case IMAGE_FORMAT_JPG:
            case IMAGE_FORMAT_JPEG:
                imageType = BufferedImage.TYPE_INT_RGB;
                break;
            default:
                imageType = BufferedImage.TYPE_INT_ARGB;
        }
        BufferedImage image = new BufferedImage(width, height, imageType);
        return image;
    }

    /**
     * Check if the image is fully transparent, meaning it contains only
     * transparent pixels as an empty image
     *
     * @param image
     *            image
     * @return true if fully transparent
     */
    public static boolean isFullyTransparent(BufferedImage image) {
        boolean transparent = true;
        for (int x = 0; x < image.getWidth(); x++) {
            for (int y = 0; y < image.getHeight(); y++) {
                transparent = isTransparent(image, x, y);
                if (!transparent) {
                    break;
                }
            }
            if (!transparent) {
                break;
            }
        }
        return transparent;
    }

    /**
     * Check if the pixel in the image at the x and y is transparent
     *
     * @param image
     *            image
     * @param x
     *            x location
     * @param y
     *            y location
     * @return true if transparent
     */
    public static boolean isTransparent(BufferedImage image, int x, int y) {
        int pixel = image.getRGB(x, y);
        boolean transparent = (pixel >> 24) == 0x00;
        return transparent;
    }

    /**
     * Get a buffered image of the image bytes
     *
     * @param imageBytes
     *            image bytes
     * @return buffered image or null
     * @throws IOException
     *             upon failure
     * @since 1.1.2
     */
    public static BufferedImage getImage(byte[] imageBytes) throws IOException {
        BufferedImage image = null;
        if (imageBytes != null) {
            ByteArrayInputStream stream = new ByteArrayInputStream(imageBytes);
            image = ImageIO.read(stream);
            stream.close();
        }
        return image;
    }

    /**
     * Write the image to bytes in the provided format and optional quality
     *
     * @param image
     *            buffered image
     * @param formatName
     *            image format name
     * @param quality
     *            null or quality between 0.0 and 1.0
     * @return image bytes
     * @throws IOException
     *             upon failure
     * @since 1.1.2
     */
    public static byte[] writeImageToBytes(BufferedImage image, String formatName, Float quality) throws IOException {
        byte[] bytes = null;
        if (quality != null) {
            bytes = compressAndWriteImageToBytes(image, formatName, quality);
        } else {
            bytes = writeImageToBytes(image, formatName);
        }
        return bytes;
    }

    /**
     * Write the image to bytes in the provided format
     *
     * @param image
     *            buffered image
     * @param formatName
     *            image format name
     * @return image bytes
     * @throws IOException
     *             upon failure
     * @since 1.1.2
     */
    public static byte[] writeImageToBytes(BufferedImage image, String formatName) throws IOException {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        ImageIO.write(image, formatName, stream);
        stream.flush();
        byte[] bytes = stream.toByteArray();
        stream.close();
        return bytes;
    }

    /**
     * Compress and write the image to bytes in the provided format and quality
     *
     * @param image
     *            buffered image
     * @param formatName
     *            image format name
     * @param quality
     *            quality between 0.0 and 1.0
     * @return compressed image bytes
     * @since 1.1.2
     */
    public static byte[] compressAndWriteImageToBytes(BufferedImage image, String formatName, float quality) {
        byte[] bytes = null;
        Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(formatName);
        if (writers == null || !writers.hasNext()) {
            throw new GeoPackageException("No Image Writer to compress format: " + formatName);
        }
        ImageWriter writer = writers.next();
        ImageWriteParam writeParam = writer.getDefaultWriteParam();
        writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
        writeParam.setCompressionQuality(quality);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ImageOutputStream ios = null;
        try {
            ios = ImageIO.createImageOutputStream(baos);
            writer.setOutput(ios);
            writer.write(null, new IIOImage(image, null, null), writeParam);
            writer.dispose();
            bytes = baos.toByteArray();
        } catch (IOException e) {
            throw new GeoPackageException("Failed to compress image to format: " + formatName + ", with quality: " + quality, e);
        } finally {
            closeQuietly(ios);
            closeQuietly(baos);
        }
        return bytes;
    }

    /**
     * Close quietly
     *
     * @param closeable
     *            closeable
     * @since 1.1.2
     */
    public static void closeQuietly(Closeable closeable) {
        if (closeable != null) {


public String getDrl() {
        StringBuffer sb = new StringBuffer();
        for (String rule : rules) {
            sb.append(rule).append("\n");
        }
        return sb.toString();
    }

package org.drools.template.parser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.mvel2.integration.VariableResolverFactory;
import org.mvel2.integration.impl.MapVariableResolverFactory;
import org.mvel2.templates.CompiledTemplate;
import org.mvel2.templates.SimpleTemplateRegistry;
import org.mvel2.templates.TemplateCompiler;
import org.mvel2.templates.TemplateRegistry;
import org.mvel2.templates.TemplateRuntime;

/**
 * Generate the rules for a decision table row from a rule template.
 */
public class DefaultGenerator implements Generator {

    private Map<String, RuleTemplate> ruleTemplates;

    private TemplateRegistry registry = new SimpleTemplateRegistry();

    private List<String> rules = new ArrayList<String>();

    public DefaultGenerator(final Map<String, RuleTemplate> t) {
        ruleTemplates = t;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.kie.decisiontable.parser.Generator#generate(java.lang.String,
     *      org.kie.decisiontable.parser.Row)
     */
    public void generate(String templateName, Row row) {
        try {
            CompiledTemplate template = getTemplate(templateName);
            VariableResolverFactory factory = new MapVariableResolverFactory();
            Map<String, Object> vars = new HashMap<String, Object>();
            initializePriorCommaConstraints(vars);
            initializeHasPriorJunctionConstraint(vars);
            vars.put("row", row);
            for (Cell cell : row.getCells()) {
                cell.addValue(vars);
            }
            String drl = String.valueOf(TemplateRuntime.execute(template, vars, factory, registry));
            rules.add(drl);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private void initializePriorCommaConstraints(final Map<String, Object> vars) {
        for (int depth = 0; depth < 10; depth++) {
            vars.put("hasPriorCommaConstraint" + depth, false);
        }
    }

    private void initializeHasPriorJunctionConstraint(final Map<String, Object> vars) {
        for (int depth = 0; depth < 10; depth++) {
            vars.put("hasPriorJunctionConstraint" + depth, false);
        }
    }

    private CompiledTemplate getTemplate(String templateName) throws IOException {
        CompiledTemplate contents;
        if (!registry.contains(templateName)) {
            RuleTemplate template = ruleTemplates.get(templateName);
            contents = TemplateCompiler.compileTemplate(template.getContents());
            registry.addNamedTemplate(templateName, contents);
        } else {
            contents = registry.getNamedTemplate(templateName);
        }
        return contents;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.kie.decisiontable.parser.Generator#getDrl()
     */


for (int depth = 0; depth < 10; depth++) {
            vars.put("hasPriorCommaConstraint" + depth, false);
        }

package org.drools.template.parser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.mvel2.integration.VariableResolverFactory;
import org.mvel2.integration.impl.MapVariableResolverFactory;
import org.mvel2.templates.CompiledTemplate;
import org.mvel2.templates.SimpleTemplateRegistry;
import org.mvel2.templates.TemplateCompiler;
import org.mvel2.templates.TemplateRegistry;
import org.mvel2.templates.TemplateRuntime;

/**
 * Generate the rules for a decision table row from a rule template.
 */
public class DefaultGenerator implements Generator {

    private Map<String, RuleTemplate> ruleTemplates;

    private TemplateRegistry registry = new SimpleTemplateRegistry();

    private List<String> rules = new ArrayList<String>();

    public DefaultGenerator(final Map<String, RuleTemplate> t) {
        ruleTemplates = t;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.kie.decisiontable.parser.Generator#generate(java.lang.String,
     *      org.kie.decisiontable.parser.Row)
     */
    public void generate(String templateName, Row row) {
        try {
            CompiledTemplate template = getTemplate(templateName);
            VariableResolverFactory factory = new MapVariableResolverFactory();
            Map<String, Object> vars = new HashMap<String, Object>();
            initializePriorCommaConstraints(vars);
            initializeHasPriorJunctionConstraint(vars);
            vars.put("row", row);
            for (Cell cell : row.getCells()) {
                cell.addValue(vars);
            }
            String drl = String.valueOf(TemplateRuntime.execute(template, vars, factory, registry));
            rules.add(drl);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private void initializePriorCommaConstraints(final Map<String, Object> vars) {

    }

    private void initializeHasPriorJunctionConstraint(final Map<String, Object> vars) {
        for (int depth = 0; depth < 10; depth++) {
            vars.put("hasPriorJunctionConstraint" + depth, false);
        }
    }

    private CompiledTemplate getTemplate(String templateName) throws IOException {
        CompiledTemplate contents;
        if (!registry.contains(templateName)) {
            RuleTemplate template = ruleTemplates.get(templateName);
            contents = TemplateCompiler.compileTemplate(template.getContents());
            registry.addNamedTemplate(templateName, contents);
        } else {
            contents = registry.getNamedTemplate(templateName);
        }
        return contents;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.kie.decisiontable.parser.Generator#getDrl()
     */
    public String getDrl() {
        StringBuffer sb = new StringBuffer();
        for (String rule : rules) {
            sb.append(rule).append("\n");
        }
        return sb.toString();
    }
}


public ImmutableList<ExprRootNode> getArgs() {
        return getExprList();
    }

package com.google.template.soy.soytree;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.template.soy.base.SourceLocation;
import com.google.template.soy.base.internal.Identifier;
import com.google.template.soy.basetree.CopyState;
import com.google.template.soy.exprtree.ExprNode;
import com.google.template.soy.exprtree.ExprRootNode;
import com.google.template.soy.plugin.restricted.SoySourceFunction;
import com.google.template.soy.shared.restricted.SoyPrintDirective;
import com.google.template.soy.soytree.SoyNode.ExprHolderNode;
import java.util.List;
import javax.annotation.Nullable;

/**
 * Node representing a 'print' directive.
 *
 * <p>Important: Do not use outside of Soy code (treat as superpackage-private).
 */
public final class PrintDirectiveNode extends AbstractSoyNode implements ExprHolderNode {

    public static PrintDirectiveNode createSyntheticNode(int id, Identifier name, SourceLocation location) {
        return new PrintDirectiveNode(id, name, location, ImmutableList.of(), true);
    }

    public static PrintDirectiveNode createSyntheticNode(int id, Identifier name, SourceLocation location, SoyPrintDirective printDirective) {
        PrintDirectiveNode node = createSyntheticNode(id, name, location);
        node.setPrintDirective(printDirective);
        return node;
    }

    private final Identifier name;

    private SoyPrintDirective printDirective;

    private SoySourceFunction printDirectiveFunction;

    /**
     * The parsed args.
     */
    private final ImmutableList<ExprRootNode> args;

    /**
     * This means that the directive was inserted by the compiler, typically the autoescaper.
     * Otherwise it means that a user wrote it.
     */
    private final boolean isSynthetic;

    public PrintDirectiveNode(int id, Identifier name, SourceLocation location, ImmutableList<ExprNode> args) {
        this(id, name, location, args, false);
    }

    private PrintDirectiveNode(int id, Identifier name, SourceLocation location, ImmutableList<ExprNode> args, boolean isSynthetic) {
        super(id, location);
        this.name = name;
        this.args = ExprRootNode.wrap(args);
        this.isSynthetic = isSynthetic;
    }

    /**
     * Copy constructor.
     *
     * @param orig The node to copy.
     */
    private PrintDirectiveNode(PrintDirectiveNode orig, CopyState copyState) {
        super(orig, copyState);
        List<ExprRootNode> tempArgs = Lists.newArrayListWithCapacity(orig.args.size());
        for (ExprRootNode origArg : orig.args) {
            tempArgs.add(origArg.copy(copyState));
        }
        this.name = orig.name;
        this.args = ImmutableList.copyOf(tempArgs);
        this.printDirective = orig.printDirective;
        this.printDirectiveFunction = orig.printDirectiveFunction;
        this.isSynthetic = orig.isSynthetic;
    }

    @Override
    public Kind getKind() {
        return Kind.PRINT_DIRECTIVE_NODE;
    }

    /**
     * Returns the directive name (including vertical bar).
     */
    public String getName() {
        return name.identifier();
    }

    public SourceLocation getNameLocation() {
        return name.location();
    }

    /**
     * Returns true if this node was inserted by the autoescaper.
     */
    public boolean isSynthetic() {
        return isSynthetic;
    }

    /**
     * The parsed args.
     */

    @Override
    public String toSourceString() {
        return args.isEmpty() ? getName() : getName() + ":" + SoyTreeUtils.toSourceString(args);
    }

    @Override
    public ImmutableList<ExprRootNode> getExprList() {
        return args;
    }

    @Override
    public PrintDirectiveNode copy(CopyState copyState) {
        return new PrintDirectiveNode(this, copyState);
    }

    /**
     * Returns the print directive for this node.
     */
    public SoyPrintDirective getPrintDirective() {
        checkState(printDirective != null, "setPrintDirective hasn't been called yet");
        return printDirective;
    }

    /**
     * Returns the soy source function that can be used to implement this directive.
     */
    @Nullable
    public SoySourceFunction getPrintDirectiveFunction() {
        return printDirectiveFunction;
    }

    /**
     * Sets the print directive.
     */
    public void setPrintDirective(SoyPrintDirective printDirective) {
        checkState(this.printDirective == null, "setPrintDirective has already been called");
        checkArgument(name.identifier().equals(printDirective.getName()));
        this.printDirective = checkNotNull(printDirective);
    }

    /**
     * Sets the print directive. A later compiler pass will rewrite the node to use this function.
     */
    public void setPrintDirectiveFunction(SoySourceFunction sourceFunction) {
        checkState(this.printDirectiveFunction == null, "setPrintDirectiveFunction has already been called");
        this.printDirectiveFunction = checkNotNull(sourceFunction);
    }
}


@Nullable
    KnownVersion getVersion();

package org.apache.geode.internal.serialization;

import java.io.DataInput;
import java.io.DataOutput;
import org.jetbrains.annotations.Nullable;

/**
 * An extension to {@link DataOutput}, {@link DataInput} used internally in product to indicate that
 * the input/output stream is attached to a GemFire peer having a different version.
 *
 * Internal product classes that implement {@link DataSerializableFixedID}
 * and change serialization format must check this on DataInput/DataOutput
 * (see {@link SerializationContext#getSerializationVersion()} methods) and deal with serialization
 * with previous {@link KnownVersion}s appropriately.
 */
public interface VersionedDataStream {

    /**
     * If the remote peer to which this input/output is connected has a version ordinal
     * for which a {@link KnownVersion} is known (locally) then that {@link KnownVersion} is returned,
     * otherwise null is returned.
     *
     * If the peer has a version ordinal for which no {@link KnownVersion} is locally known,
     * then this member cannot do any adjustment to serialization and it's the remote
     * peer's responsibility to adjust the serialization/deserialization according to
     * this peer.
     */


public Writable<WritableOnDisk> getStatistics() {
        if (statistics.getKeyFigureCardsCount() == 0) {
            return null;
        } else {
            return new StatisticsDirectory(cryptoProvider, distributionServiceConfig, statistics).getStatisticsArchive();
        }
    }

package app.coronawarn.server.services.distribution.assembly.component;

import app.coronawarn.server.common.protocols.internal.stats.Statistics;
import app.coronawarn.server.services.distribution.assembly.structure.Writable;
import app.coronawarn.server.services.distribution.assembly.structure.WritableOnDisk;
import app.coronawarn.server.services.distribution.config.DistributionServiceConfig;
import app.coronawarn.server.services.distribution.statistics.directory.StatisticsDirectory;
import org.springframework.stereotype.Component;

/**
 * Reads configuration parameters from the respective files in the class path and build a {@link
 * StatisticsStructureProvider} with them.
 */
@Component
public class StatisticsStructureProvider {

    private final CryptoProvider cryptoProvider;

    private final DistributionServiceConfig distributionServiceConfig;

    private final Statistics statistics;

    public StatisticsStructureProvider(CryptoProvider cryptoProvider, DistributionServiceConfig distributionServiceConfig, Statistics statistics) {
        this.cryptoProvider = cryptoProvider;
        this.distributionServiceConfig = distributionServiceConfig;
        this.statistics = statistics;
    }

    /**
     * Returns a list containing the archives with Statistics for
     * mobile clients using signature file.
     */


for (int i = 0; i < add.size(); i++) {
                add.getValueMeta(i).setOrigin(name);
            }

/*! ******************************************************************************
 *
 * Pentaho Data Integration
 *
 *
 *******************************************************************************
 *
 *
 ******************************************************************************/
package org.pentaho.di.trans.steps.filesfromresult;

import java.util.List;
import org.pentaho.di.core.CheckResult;
import org.pentaho.di.core.CheckResultInterface;
import org.pentaho.di.core.ResultFile;
import org.pentaho.di.core.RowMetaAndData;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleFileException;
import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.vfs.KettleVFS;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.BaseStepMeta;
import org.pentaho.di.trans.step.StepDataInterface;
import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.step.StepMetaInterface;
import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Node;

public class FilesFromResultMeta extends BaseStepMeta implements StepMetaInterface {

    // for i18n purposes, needed by Translator2!!
    private static Class<?> PKG = FilesFromResult.class;

    public FilesFromResultMeta() {
        // allocate BaseStepMeta
        super();
    }

    public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
        readData(stepnode);
    }

    public Object clone() {
        Object retval = super.clone();
        return retval;
    }

    private void readData(Node stepnode) {
    }

    public void setDefault() {
    }

    public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
    }

    public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException {
    }

    public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
        // Add the fields from a ResultFile
        try {
            ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject("foo.bar", space), "parentOrigin", "origin");
            RowMetaAndData add = resultFile.getRow();
            // Set the origin on the fields...

            r.addRowMeta(add.getRowMeta());
        } catch (KettleFileException e) {
            throw new KettleStepException(e);
        }
    }

    public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
        // See if we have input streams leading to this step!
        if (input.length > 0) {
            CheckResult cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FilesFromResultMeta.CheckResult.StepExpectingNoReadingInfoFromOtherSteps"), stepMeta);
            remarks.add(cr);
        } else {
            CheckResult cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FilesFromResultMeta.CheckResult.NoInputReceivedError"), stepMeta);
            remarks.add(cr);
        }
    }

    public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans trans) {
        return new FilesFromResult(stepMeta, stepDataInterface, cnr, transMeta, trans);
    }

    public StepDataInterface getStepData() {
        return new FilesFromResultData();
    }
}


/**
 * ****************************************************************************
 *
 *  Contributors:
 *      Ericsson - Initial API and implementation
 * *****************************************************************************
 */
package org.eclipse.cdt.dsf.gdb.launching;

/**
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 *
 * @since 4.0
 */
public interface IProcessExtendedInfo {

    /**
     * Returns the pid of the process, as assigned by the OS.
     */
    public int getPid();

    /**
     * Returns the name of the process, as assigned by the OS.
     * Returns null if that information is not available.
     */

    /**
     * Returns a list of cores on which the process is located.
     * This list is all cores on which at least one thread of the
     * process is located.
     * Returns null if that information is not available.
     */
    public String[] getCores();

    /**
     * Returns the owner of the process.  Usually the userId
     * that started the process.  Returns null if that
     * information is not available.
     */
    public String getOwner();
}


@SuppressWarnings("unused")
    public synchronized void clear() {
        if (appender != null) {
            appender.clear();
        }
    }

package jijimaku.utils;

import java.awt.EventQueue;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JTextArea;

/**
 * Utility class for embedding an OutputStream in a swing TextArea.
 * From http://example.com
 * @author http://example.com
 */
public class TextAreaOutputStream extends OutputStream {

    private byte[] oneByte;

    // most recent action
    private Appender appender;

    public TextAreaOutputStream(JTextArea txtara, int maxlin) {
        if (maxlin < 1) {
            throw new IllegalArgumentException("TextAreaOutputStream maximum lines must be positive (value=" + maxlin + ")");
        }
        txtara.setEditable(false);
        txtara.setLineWrap(true);
        txtara.setWrapStyleWord(true);
        oneByte = new byte[1];
        appender = new Appender(txtara, maxlin);
    }

    /**
     * Clear the current console writtenForm area.
     */

    @Override
    public synchronized void close() {
        appender = null;
    }

    @Override
    public synchronized void flush() {
    }

    @Override
    public synchronized void write(int val) {
        oneByte[0] = (byte) val;
        write(oneByte, 0, 1);
    }

    @Override
    public synchronized void write(byte[] ba) {
        write(ba, 0, ba.length);
    }

    @Override
    public synchronized void write(byte[] ba, int str, int len) {
        if (appender != null) {
            appender.append(bytesToString(ba, str, len));
        }
    }

    private static String bytesToString(byte[] ba, int str, int len) {
        try {
            return new String(ba, str, len, "UTF-8");
        } catch (UnsupportedEncodingException thr) {
            return new String(ba, str, len);
        }
        // all JVMs are required to support UTF-8
    }

    private static class Appender implements Runnable {

        private final JTextArea textArea;

        // maximum lines allowed in writtenForm area
        private final int maxLines;

        // length of lines within writtenForm area
        private final LinkedList<Integer> lengths;

        // values waiting to be appended
        private final List<String> values;

        // length of current line
        private int curLength;

        private boolean clear;

        private boolean queue;

        Appender(JTextArea txtara, int maxlin) {
            textArea = txtara;
            maxLines = maxlin;
            lengths = new LinkedList<>();
            values = new ArrayList<>();
            curLength = 0;
            clear = false;
            queue = true;
        }

        synchronized void append(String val) {
            values.add(val);
            if (queue) {
                queue = false;
                EventQueue.invokeLater(this);
            }
        }

        synchronized void clear() {
            clear = true;
            curLength = 0;
            lengths.clear();
            values.clear();
            if (queue) {
                queue = false;
                EventQueue.invokeLater(this);
            }
        }

        /**
         * MUST BE THE ONLY METHOD THAT TOUCHES textArea.
         */
        public synchronized void run() {
            if (clear) {
                textArea.setText("");
            }
            for (String val : values) {
                curLength += val.length();
                if (val.endsWith(EOL1) || val.endsWith(EOL2)) {
                    if (lengths.size() >= maxLines) {
                        textArea.replaceRange("", 0, lengths.removeFirst());
                    }
                    lengths.addLast(curLength);
                    curLength = 0;
                }
                textArea.append(val);
            }
            values.clear();
            clear = false;
            queue = true;
        }

        private static final String EOL1 = "\n";

        private static final String EOL2 = System.getProperty("line.separator", EOL1);
    }
}
/* END PUBLIC CLASS */


try {
            return new String(ba, str, len, "UTF-8");
        } catch (UnsupportedEncodingException thr) {
            return new String(ba, str, len);
        }

package jijimaku.utils;

import java.awt.EventQueue;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JTextArea;

/**
 * Utility class for embedding an OutputStream in a swing TextArea.
 * From http://example.com
 * @author http://example.com
 */
public class TextAreaOutputStream extends OutputStream {

    private byte[] oneByte;

    // most recent action
    private Appender appender;

    public TextAreaOutputStream(JTextArea txtara, int maxlin) {
        if (maxlin < 1) {
            throw new IllegalArgumentException("TextAreaOutputStream maximum lines must be positive (value=" + maxlin + ")");
        }
        txtara.setEditable(false);
        txtara.setLineWrap(true);
        txtara.setWrapStyleWord(true);
        oneByte = new byte[1];
        appender = new Appender(txtara, maxlin);
    }

    /**
     * Clear the current console writtenForm area.
     */
    @SuppressWarnings("unused")
    public synchronized void clear() {
        if (appender != null) {
            appender.clear();
        }
    }

    @Override
    public synchronized void close() {
        appender = null;
    }

    @Override
    public synchronized void flush() {
    }

    @Override
    public synchronized void write(int val) {
        oneByte[0] = (byte) val;
        write(oneByte, 0, 1);
    }

    @Override
    public synchronized void write(byte[] ba) {
        write(ba, 0, ba.length);
    }

    @Override
    public synchronized void write(byte[] ba, int str, int len) {
        if (appender != null) {
            appender.append(bytesToString(ba, str, len));
        }
    }

    private static String bytesToString(byte[] ba, int str, int len) {

        // all JVMs are required to support UTF-8
    }

    private static class Appender implements Runnable {

        private final JTextArea textArea;

        // maximum lines allowed in writtenForm area
        private final int maxLines;

        // length of lines within writtenForm area
        private final LinkedList<Integer> lengths;

        // values waiting to be appended
        private final List<String> values;

        // length of current line
        private int curLength;

        private boolean clear;

        private boolean queue;

        Appender(JTextArea txtara, int maxlin) {
            textArea = txtara;
            maxLines = maxlin;
            lengths = new LinkedList<>();
            values = new ArrayList<>();
            curLength = 0;
            clear = false;
            queue = true;
        }

        synchronized void append(String val) {
            values.add(val);
            if (queue) {
                queue = false;
                EventQueue.invokeLater(this);
            }
        }

        synchronized void clear() {
            clear = true;
            curLength = 0;
            lengths.clear();
            values.clear();
            if (queue) {
                queue = false;
                EventQueue.invokeLater(this);
            }
        }

        /**
         * MUST BE THE ONLY METHOD THAT TOUCHES textArea.
         */
        public synchronized void run() {
            if (clear) {
                textArea.setText("");
            }
            for (String val : values) {
                curLength += val.length();
                if (val.endsWith(EOL1) || val.endsWith(EOL2)) {
                    if (lengths.size() >= maxLines) {
                        textArea.replaceRange("", 0, lengths.removeFirst());
                    }
                    lengths.addLast(curLength);
                    curLength = 0;
                }
                textArea.append(val);
            }
            values.clear();
            clear = false;
            queue = true;
        }

        private static final String EOL1 = "\n";

        private static final String EOL2 = System.getProperty("line.separator", EOL1);
    }
}
/* END PUBLIC CLASS */


package org.apache.tuweni.scuttlebutt.rpc.mux;

import org.apache.tuweni.scuttlebutt.rpc.RPCResponse;

/**
 * Handles incoming items from a result stream
 */
public interface ScuttlebuttStreamHandler {

    /**
     * Handles a new message from the result stream.
     *
     * @param message a new message appearing.
     */
    void onMessage(RPCResponse message);

    /**
     * Invoked when the stream has been closed.
     */
    void onStreamEnd();

    /**
     * Invoked when there is an error in the stream.
     *
     * @param ex the underlying error
     */


for (int i = N - nPoints / 2; i < N; i++) {
            ret[i] = signal[i];
        }

package math;

public class Tools {

    public static final double TWO_PI = 2 * Math.PI;

    public static final double LOG_OF_2_BASE_10 = 1 / Math.log10(2);

    public static double log2(double x) {
        return Math.log10(x) / Math.log10(2.0);
    }

    public static final double[] lowpass(double[] signal, int nPoints) {
        int N = signal.length;
        double[] ret = new double[N];
        for (int i = 0; i < nPoints / 2; i++) {
            ret[i] = signal[i];
        }
        for (int i = nPoints / 2; i < N - nPoints / 2; i++) {
            for (int j = 0; j < nPoints; j++) {
                ret[i] = 0;
                ret[i] += signal[i - nPoints / 2 + j];
                ret[i] /= nPoints;
            }
        }

        return ret;
    }

    public static final double[] addArrays(double[] x, double[] y) {
        double[] sum = new double[x.length];
        for (int i = 0; i < x.length; i++) {
            sum[i] = x[i] + y[i];
        }
        return sum;
    }

    public static final Complex[] addArrays(Complex[] x, Complex[] y) {
        Complex[] sum = new Complex[x.length];
        for (int i = 0; i < x.length; i++) {
            sum[i] = Complex.add(x[i], y[i]);
        }
        return sum;
    }

    public static final Complex[] substractArrays(Complex[] x, Complex[] y) {
        Complex[] sum = new Complex[x.length];
        for (int i = 0; i < x.length; i++) {
            sum[i] = Complex.substract(x[i], y[i]);
        }
        return sum;
    }

    public static final double[] dotProduct(double[] x, double[] y) {
        double[] sum = new double[x.length];
        for (int i = 0; i < x.length; i++) {
            sum[i] = x[i] * y[i];
        }
        return sum;
    }

    public static final Complex[] dotProduct(Complex[] x, Complex[] y) {
        Complex[] sum = new Complex[x.length];
        for (int i = 0; i < x.length; i++) {
            sum[i] = Complex.multiply(x[i], y[i]);
        }
        return sum;
    }

    public static Complex[] makeComplex(double[] x) {
        int N = x.length;
        Complex[] c = new Complex[N];
        for (int i = 0; i < N; i++) {
            c[i] = new Complex(x[i], 0);
        }
        return c;
    }

    public static void printArray(double[] arr) {
        for (double d : arr) {
            System.out.format("%.4f ", d);
        }
        System.out.println();
    }
}


for (int i = 0; i < nformats; i++) {
                    final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilitiesNoCheck(sharedResource, device, glProfile, sharedHdc, pformats.get(i), winattrPbuffer);
                    System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
                }

/*
 *
 *
 * Sun gratefully acknowledges that this software was originally authored
 * and developed by Kenneth Bradley Russell and Christopher John Kline.
 */
package jogamp.opengl.windows.wgl;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import com.jogamp.nativewindow.AbstractGraphicsDevice;
import com.jogamp.nativewindow.NativeSurface;
import com.jogamp.nativewindow.NativeWindowException;
import com.jogamp.nativewindow.MutableSurface;
import com.jogamp.opengl.GLCapabilitiesImmutable;
import com.jogamp.opengl.GLContext;
import com.jogamp.opengl.GLDrawableFactory;
import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLProfile;
import com.jogamp.common.nio.Buffers;
import jogamp.nativewindow.windows.GDI;
import jogamp.opengl.GLDrawableImpl;
import jogamp.opengl.GLGraphicsConfigurationUtil;
import jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.SharedResource;

public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {

    // cached WGLExt instance from parent GLCanvas,
    private WGLExt cachedWGLExt;

    // needed to destroy pbuffer
    // pbuffer handle
    private long buffer;

    protected WindowsPbufferWGLDrawable(final GLDrawableFactory factory, final NativeSurface target) {
        super(factory, target, false);
    }

    @Override
    protected void setRealizedImpl() {
        if (realized) {
            createPbuffer();
        } else {
            destroyPbuffer();
        }
    }

    @Override
    public GLContext createContext(final GLContext shareWith) {
        return new WindowsWGLContext(this, shareWith);
    }

    protected void destroyPbuffer() {
        final NativeSurface ns = getNativeSurface();
        if (0 != buffer) {
            final WGLExt wglExt = cachedWGLExt;
            if (ns.getSurfaceHandle() != 0) {
                // Must release DC and pbuffer
                // NOTE that since the context is not current, glGetError() can
                // not be called here, so we skip the use of any composable
                // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl)
                if (wglExt.wglReleasePbufferDCARB(buffer, ns.getSurfaceHandle()) == 0) {
                    throw new GLException("Error releasing pbuffer device context: error code " + GDI.GetLastError());
                }
                ((MutableSurface) ns).setSurfaceHandle(0);
            }
            if (!wglExt.wglDestroyPbufferARB(buffer)) {
                throw new GLException("Error destroying pbuffer: error code " + GDI.GetLastError());
            }
            buffer = 0;
        }
    }

    public long getPbufferHandle() {
        // The actual to-be-used handle for makeCurrent etc,
        // is the derived DC, set in the NativeSurface surfaceHandle
        // returned by getHandle().
        return buffer;
    }

    private void createPbuffer() {
        final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
        final SharedResource sharedResource = ((WindowsWGLDrawableFactory) factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
        final NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
        if (NativeSurface.LOCK_SURFACE_NOT_READY >= sharedSurface.lockSurface()) {
            throw new NativeWindowException("Could not lock (sharedSurface): " + this);
        }
        try {
            final long sharedHdc = sharedSurface.getSurfaceHandle();
            final WGLExt wglExt = ((WindowsWGLContext) sharedResource.getContext()).getWGLExt();
            if (DEBUG) {
                System.err.println(getThreadName() + ": Pbuffer config: " + config);
            }
            final int winattrPbuffer = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(false, /* onscreen */
            false, /* fbo */
            true, /* pbuffer */
            false);
            final IntBuffer iattributes = Buffers.newDirectIntBuffer(2 * WindowsWGLGraphicsConfiguration.MAX_ATTRIBS);
            final FloatBuffer fattributes = Buffers.newDirectFloatBuffer(1);
            final int[] floatModeTmp = new int[1];
            int niattribs = 0;
            final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
            final GLProfile glProfile = chosenCaps.getGLProfile();
            final AbstractGraphicsDevice device = config.getScreen().getDevice();
            if (DEBUG) {
                System.err.println(getThreadName() + ": Pbuffer parentHdc = " + toHexString(sharedHdc));
                System.err.println(getThreadName() + ": Pbuffer chosenCaps: " + chosenCaps);
            }
            if (!WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(sharedResource, chosenCaps, iattributes, -1, floatModeTmp)) {
                throw new GLException("Pbuffer-related extensions not supported");
            }
            final IntBuffer pformats = Buffers.newDirectIntBuffer(WindowsWGLGraphicsConfiguration.MAX_PFORMATS);
            final IntBuffer nformatsTmp = Buffers.newDirectIntBuffer(1);
            if (!wglExt.wglChoosePixelFormatARB(sharedHdc, iattributes, fattributes, WindowsWGLGraphicsConfiguration.MAX_PFORMATS, pformats, nformatsTmp)) {
                throw new GLException("pbuffer creation error: wglChoosePixelFormat() failed");
            }
            final int nformats = Math.min(nformatsTmp.get(0), WindowsWGLGraphicsConfiguration.MAX_PFORMATS);
            if (nformats <= 0) {
                throw new GLException("pbuffer creation error: Couldn't find a suitable pixel format");
            }
            if (DEBUG) {
                System.err.println("" + nformats + " suitable pixel formats found");

            }
            int pfdid = 0;
            long tmpBuffer = 0;
            {
                int whichFormat;
                // Loop is a workaround for bugs in NVidia's recent drivers
                for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
                    final int format = pformats.get(whichFormat);
                    // Create the p-buffer.
                    niattribs = 0;
                    iattributes.put(niattribs++, 0);
                    tmpBuffer = wglExt.wglCreatePbufferARB(sharedHdc, format, getSurfaceWidth(), getSurfaceHeight(), iattributes);
                    if (tmpBuffer != 0) {
                        // Done
                        break;
                    }
                }
                if (0 == tmpBuffer) {
                    throw new GLException("pbuffer creation error: wglCreatePbuffer() failed: tried " + nformats + " pixel formats, last error was: " + wglGetLastError());
                }
                pfdid = pformats.get(whichFormat);
            }
            // Get the device context.
            final long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
            if (tmpHdc == 0) {
                throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
            }
            final NativeSurface ns = getNativeSurface();
            // Set up instance variables
            buffer = tmpBuffer;
            ((MutableSurface) ns).setSurfaceHandle(tmpHdc);
            cachedWGLExt = wglExt;
            // Re-query chosen pixel format
            {
                final WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile, sharedHdc, pfdid, winattrPbuffer);
                if (null == newCaps) {
                    throw new GLException("pbuffer creation error: unable to re-query chosen PFD ID: " + pfdid + ", hdc " + GLDrawableImpl.toHexString(tmpHdc));
                }
                if (newCaps.isOnscreen() || !newCaps.isPBuffer()) {
                    throw new GLException("Error: Selected Onscreen Caps for PBuffer: " + newCaps);
                }
                config.setCapsPFD(newCaps);
            }
        } finally {
            sharedSurface.unlockSurface();
        }
    }

    private static String wglGetLastError() {
        return WindowsWGLDrawableFactory.wglGetLastError();
    }
}


for (int i = 0; i < numBoosterRare; i++) {
            List<CardInfo> cards = (checkMythic() ? mythics : rares);
            while (true) {
                addToBooster(booster, cards);
                int check = addMissingPartner(booster, partnerAllowed, -1, 1);
                if (check == 1) {
                    break;
                }
                if (check == 2) {
                    partnerAllowed = false;
                    break;
                }
            }
        }

package mage.sets;

import mage.abilities.Ability;
import mage.abilities.keyword.PartnerWithAbility;
import mage.cards.Card;
import mage.cards.ExpansionSet;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.constants.Rarity;
import mage.constants.SetType;
import java.util.ArrayList;
import java.util.List;

/**
 * @author TheElk801
 */
public final class Battlebond extends ExpansionSet {

    private static final Battlebond instance = new Battlebond();

    public static Battlebond getInstance() {
        return instance;
    }

    private Battlebond() {
        super("Battlebond", "BBD", ExpansionSet.buildDate(2018, 6, 8), SetType.SUPPLEMENTAL);
        this.blockName = "Battlebond";
        this.hasBasicLands = true;
        this.hasBoosters = true;
        this.numBoosterLands = 1;
        this.numBoosterCommon = 10;
        this.numBoosterUncommon = 3;
        this.numBoosterRare = 1;
        this.ratioBoosterMythic = 8;
        // Don't use the 2 foil mystics copies because it would influence a random ratio
        this.maxCardNumberInBooster = 254;
        cards.add(new SetCardInfo("Aim High", 189, Rarity.UNCOMMON, mage.cards.a.AimHigh.class));
        cards.add(new SetCardInfo("Angel of Retribution", 86, Rarity.UNCOMMON, mage.cards.a.AngelOfRetribution.class));
        cards.add(new SetCardInfo("Angelic Chorus", 87, Rarity.RARE, mage.cards.a.AngelicChorus.class));
        cards.add(new SetCardInfo("Angelic Gift", 88, Rarity.COMMON, mage.cards.a.AngelicGift.class));
        cards.add(new SetCardInfo("Apocalypse Hydra", 217, Rarity.RARE, mage.cards.a.ApocalypseHydra.class));
        cards.add(new SetCardInfo("Arcane Artisan", 33, Rarity.MYTHIC, mage.cards.a.ArcaneArtisan.class));
        cards.add(new SetCardInfo("Archfiend of Despair", 44, Rarity.MYTHIC, mage.cards.a.ArchfiendOfDespair.class));
        cards.add(new SetCardInfo("Archon of Valor's Reach", 74, Rarity.RARE, mage.cards.a.ArchonOfValorsReach.class));
        cards.add(new SetCardInfo("Arena Rector", 23, Rarity.MYTHIC, mage.cards.a.ArenaRector.class));
        cards.add(new SetCardInfo("Assassin's Strike", 138, Rarity.UNCOMMON, mage.cards.a.AssassinsStrike.class));
        cards.add(new SetCardInfo("Assassinate", 139, Rarity.COMMON, mage.cards.a.Assassinate.class));
        cards.add(new SetCardInfo("Auger Spree", 218, Rarity.COMMON, mage.cards.a.AugerSpree.class));
        cards.add(new SetCardInfo("Aurora Champion", 24, Rarity.COMMON, mage.cards.a.AuroraChampion.class));
        cards.add(new SetCardInfo("Azra Bladeseeker", 55, Rarity.COMMON, mage.cards.a.AzraBladeseeker.class));
        cards.add(new SetCardInfo("Azra Oddsmaker", 75, Rarity.UNCOMMON, mage.cards.a.AzraOddsmaker.class));
        cards.add(new SetCardInfo("Bathe in Dragonfire", 164, Rarity.COMMON, mage.cards.b.BatheInDragonfire.class));
        cards.add(new SetCardInfo("Battle Mastery", 89, Rarity.UNCOMMON, mage.cards.b.BattleMastery.class));
        cards.add(new SetCardInfo("Battle Rampart", 165, Rarity.COMMON, mage.cards.b.BattleRampart.class));
        cards.add(new SetCardInfo("Battle-Rattle Shaman", 166, Rarity.UNCOMMON, mage.cards.b.BattleRattleShaman.class));
        cards.add(new SetCardInfo("Beast Within", 190, Rarity.UNCOMMON, mage.cards.b.BeastWithin.class));
        cards.add(new SetCardInfo("Benthic Giant", 113, Rarity.COMMON, mage.cards.b.BenthicGiant.class));
        cards.add(new SetCardInfo("Blaring Captain", 14, Rarity.UNCOMMON, mage.cards.b.BlaringCaptain.class));
        cards.add(new SetCardInfo("Blaring Recruiter", 13, Rarity.UNCOMMON, mage.cards.b.BlaringRecruiter.class));
        cards.add(new SetCardInfo("Blaze", 167, Rarity.UNCOMMON, mage.cards.b.Blaze.class));
        cards.add(new SetCardInfo("Blood Feud", 168, Rarity.UNCOMMON, mage.cards.b.BloodFeud.class));
        cards.add(new SetCardInfo("Bloodborn Scoundrels", 45, Rarity.COMMON, mage.cards.b.BloodbornScoundrels.class));
        cards.add(new SetCardInfo("Boldwyr Intimidator", 169, Rarity.UNCOMMON, mage.cards.b.BoldwyrIntimidator.class));
        cards.add(new SetCardInfo("Bonus Round", 56, Rarity.RARE, mage.cards.b.BonusRound.class));
        cards.add(new SetCardInfo("Borderland Marauder", 170, Rarity.COMMON, mage.cards.b.BorderlandMarauder.class));
        cards.add(new SetCardInfo("Bountiful Promenade", 81, Rarity.RARE, mage.cards.b.BountifulPromenade.class));
        cards.add(new SetCardInfo("Bramble Sovereign", 65, Rarity.MYTHIC, mage.cards.b.BrambleSovereign.class));
        cards.add(new SetCardInfo("Brightling", 25, Rarity.MYTHIC, mage.cards.b.Brightling.class));
        cards.add(new SetCardInfo("Bring Down", 26, Rarity.UNCOMMON, mage.cards.b.BringDown.class));
        cards.add(new SetCardInfo("Bull-Rush Bruiser", 57, Rarity.COMMON, mage.cards.b.BullRushBruiser.class));
        cards.add(new SetCardInfo("Call to Heel", 114, Rarity.COMMON, mage.cards.c.CallToHeel.class));
        cards.add(new SetCardInfo("Canopy Spider", 191, Rarity.COMMON, mage.cards.c.CanopySpider.class));
        cards.add(new SetCardInfo("Centaur Healer", 219, Rarity.COMMON, mage.cards.c.CentaurHealer.class));
        cards.add(new SetCardInfo("Chain Lightning", 171, Rarity.UNCOMMON, mage.cards.c.ChainLightning.class));
        cards.add(new SetCardInfo("Chakram Retriever", 15, Rarity.UNCOMMON, mage.cards.c.ChakramRetriever.class));
        cards.add(new SetCardInfo("Chakram Slinger", 16, Rarity.UNCOMMON, mage.cards.c.ChakramSlinger.class));
        cards.add(new SetCardInfo("Champion of Arashin", 90, Rarity.COMMON, mage.cards.c.ChampionOfArashin.class));
        cards.add(new SetCardInfo("Charging Binox", 66, Rarity.COMMON, mage.cards.c.ChargingBinox.class));
        cards.add(new SetCardInfo("Charging Rhino", 192, Rarity.COMMON, mage.cards.c.ChargingRhino.class));
        cards.add(new SetCardInfo("Cheering Fanatic", 58, Rarity.UNCOMMON, mage.cards.c.CheeringFanatic.class));
        cards.add(new SetCardInfo("Claustrophobia", 115, Rarity.COMMON, mage.cards.c.Claustrophobia.class));
        cards.add(new SetCardInfo("Combo Attack", 67, Rarity.COMMON, mage.cards.c.ComboAttack.class));
        cards.add(new SetCardInfo("Consulate Skygate", 232, Rarity.COMMON, mage.cards.c.ConsulateSkygate.class));
        cards.add(new SetCardInfo("Coralhelm Guide", 116, Rarity.COMMON, mage.cards.c.CoralhelmGuide.class));
        cards.add(new SetCardInfo("Cowl Prowler", 193, Rarity.COMMON, mage.cards.c.CowlProwler.class));
        cards.add(new SetCardInfo("Culling Dais", 233, Rarity.UNCOMMON, mage.cards.c.CullingDais.class));
        cards.add(new SetCardInfo("Daggerback Basilisk", 194, Rarity.COMMON, mage.cards.d.DaggerbackBasilisk.class));
        cards.add(new SetCardInfo("Daggerdrome Imp", 140, Rarity.COMMON, mage.cards.d.DaggerdromeImp.class));
        cards.add(new SetCardInfo("Decorated Champion", 69, Rarity.UNCOMMON, mage.cards.d.DecoratedChampion.class));
        cards.add(new SetCardInfo("Diabolic Intent", 141, Rarity.RARE, mage.cards.d.DiabolicIntent.class));
        cards.add(new SetCardInfo("Dinrova Horror", 220, Rarity.UNCOMMON, mage.cards.d.DinrovaHorror.class));
        cards.add(new SetCardInfo("Doomed Dissenter", 142, Rarity.COMMON, mage.cards.d.DoomedDissenter.class));
        cards.add(new SetCardInfo("Doomed Traveler", 91, Rarity.COMMON, mage.cards.d.DoomedTraveler.class));
        cards.add(new SetCardInfo("Doubling Season", 195, Rarity.MYTHIC, mage.cards.d.DoublingSeason.class));
        cards.add(new SetCardInfo("Dragon Breath", 172, Rarity.UNCOMMON, mage.cards.d.DragonBreath.class));
        cards.add(new SetCardInfo("Dragon Hatchling", 173, Rarity.COMMON, mage.cards.d.DragonHatchling.class));
        cards.add(new SetCardInfo("Dwarven Lightsmith", 27, Rarity.COMMON, mage.cards.d.DwarvenLightsmith.class));
        cards.add(new SetCardInfo("Eager Construct", 234, Rarity.COMMON, mage.cards.e.EagerConstruct.class));
        cards.add(new SetCardInfo("Earth Elemental", 174, Rarity.COMMON, mage.cards.e.EarthElemental.class));
        cards.add(new SetCardInfo("Elvish Visionary", 196, Rarity.COMMON, mage.cards.e.ElvishVisionary.class));
        cards.add(new SetCardInfo("Ember Beast", 175, Rarity.COMMON, mage.cards.e.EmberBeast.class));
        cards.add(new SetCardInfo("Enduring Scalelord", 221, Rarity.UNCOMMON, mage.cards.e.EnduringScalelord.class));
        cards.add(new SetCardInfo("Enthralling Victor", 176, Rarity.UNCOMMON, mage.cards.e.EnthrallingVictor.class));
        cards.add(new SetCardInfo("Evil Twin", 222, Rarity.RARE, mage.cards.e.EvilTwin.class));
        cards.add(new SetCardInfo("Expedite", 177, Rarity.COMMON, mage.cards.e.Expedite.class));
        cards.add(new SetCardInfo("Expedition Raptor", 92, Rarity.COMMON, mage.cards.e.ExpeditionRaptor.class));
        cards.add(new SetCardInfo("Eyeblight Assassin", 143, Rarity.COMMON, mage.cards.e.EyeblightAssassin.class));
        cards.add(new SetCardInfo("Fan Favorite", 46, Rarity.COMMON, mage.cards.f.FanFavorite.class));
        cards.add(new SetCardInfo("Feral Hydra", 197, Rarity.UNCOMMON, mage.cards.f.FeralHydra.class));
        cards.add(new SetCardInfo("Fertile Ground", 198, Rarity.COMMON, mage.cards.f.FertileGround.class));
        cards.add(new SetCardInfo("Fertilid", 199, Rarity.UNCOMMON, mage.cards.f.Fertilid.class));
        cards.add(new SetCardInfo("Fill with Fright", 144, Rarity.COMMON, mage.cards.f.FillWithFright.class));
        cards.add(new SetCardInfo("Flamewave Invoker", 178, Rarity.UNCOMMON, mage.cards.f.FlamewaveInvoker.class));
        cards.add(new SetCardInfo("Fog Bank", 117, Rarity.UNCOMMON, mage.cards.f.FogBank.class));
        cards.add(new SetCardInfo("Forest", 254, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Frost Lynx", 118, Rarity.COMMON, mage.cards.f.FrostLynx.class));
        cards.add(new SetCardInfo("Fumble", 34, Rarity.UNCOMMON, mage.cards.f.Fumble.class));
        cards.add(new SetCardInfo("Game Plan", 35, Rarity.RARE, mage.cards.g.GamePlan.class));
        cards.add(new SetCardInfo("Gang Up", 47, Rarity.UNCOMMON, mage.cards.g.GangUp.class));
        cards.add(new SetCardInfo("Generous Patron", 70, Rarity.RARE, mage.cards.g.GenerousPatron.class));
        cards.add(new SetCardInfo("Genesis Chamber", 235, Rarity.UNCOMMON, mage.cards.g.GenesisChamber.class));
        cards.add(new SetCardInfo("Giant Growth", 200, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
        cards.add(new SetCardInfo("Goblin Razerunners", 179, Rarity.RARE, mage.cards.g.GoblinRazerunners.class));
        cards.add(new SetCardInfo("Gold-Forged Sentinel", 236, Rarity.UNCOMMON, mage.cards.g.GoldForgedSentinel.class));
        cards.add(new SetCardInfo("Gorm the Great", 8, Rarity.RARE, mage.cards.g.GormTheGreat.class));
        cards.add(new SetCardInfo("Greater Good", 201, Rarity.RARE, mage.cards.g.GreaterGood.class));
        cards.add(new SetCardInfo("Grotesque Mutation", 145, Rarity.COMMON, mage.cards.g.GrotesqueMutation.class));
        cards.add(new SetCardInfo("Grothama, All-Devouring", 71, Rarity.MYTHIC, mage.cards.g.GrothamaAllDevouring.class));
        cards.add(new SetCardInfo("Gwafa Hazid, Profiteer", 223, Rarity.RARE, mage.cards.g.GwafaHazidProfiteer.class));
        cards.add(new SetCardInfo("Hand of Silumgar", 146, Rarity.COMMON, mage.cards.h.HandOfSilumgar.class));
        cards.add(new SetCardInfo("Hexplate Golem", 237, Rarity.COMMON, mage.cards.h.HexplateGolem.class));
        cards.add(new SetCardInfo("Huddle Up", 36, Rarity.COMMON, mage.cards.h.HuddleUp.class));
        cards.add(new SetCardInfo("Hunted Wumpus", 202, Rarity.UNCOMMON, mage.cards.h.HuntedWumpus.class));
        cards.add(new SetCardInfo("Impetuous Protege", 19, Rarity.UNCOMMON, mage.cards.i.ImpetuousProtege.class));
        cards.add(new SetCardInfo("Impulse", 119, Rarity.COMMON, mage.cards.i.Impulse.class));
        cards.add(new SetCardInfo("Inner Demon", 48, Rarity.UNCOMMON, mage.cards.i.InnerDemon.class));
        cards.add(new SetCardInfo("Island", 251, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Jelenn Sphinx", 224, Rarity.UNCOMMON, mage.cards.j.JelennSphinx.class));
        cards.add(new SetCardInfo("Jubilant Mascot", 28, Rarity.UNCOMMON, mage.cards.j.JubilantMascot.class));
        cards.add(new SetCardInfo("Juggernaut", 238, Rarity.UNCOMMON, mage.cards.j.Juggernaut.class));
        cards.add(new SetCardInfo("Jungle Wayfinder", 72, Rarity.COMMON, mage.cards.j.JungleWayfinder.class));
        cards.add(new SetCardInfo("Karametra's Favor", 203, Rarity.UNCOMMON, mage.cards.k.KarametrasFavor.class));
        cards.add(new SetCardInfo("Khorvath Brightflame", 9, Rarity.RARE, mage.cards.k.KhorvathBrightflame.class));
        cards.add(new SetCardInfo("Khorvath's Fury", 59, Rarity.RARE, mage.cards.k.KhorvathsFury.class));
        cards.add(new SetCardInfo("Kiss of the Amesha", 225, Rarity.UNCOMMON, mage.cards.k.KissOfTheAmesha.class));
        cards.add(new SetCardInfo("Kitesail Corsair", 120, Rarity.COMMON, mage.cards.k.KitesailCorsair.class));
        cards.add(new SetCardInfo("Kor Spiritdancer", 93, Rarity.RARE, mage.cards.k.KorSpiritdancer.class));
        cards.add(new SetCardInfo("Kraken Hatchling", 121, Rarity.COMMON, mage.cards.k.KrakenHatchling.class));
        cards.add(new SetCardInfo("Kraul Warrior", 204, Rarity.COMMON, mage.cards.k.KraulWarrior.class));
        cards.add(new SetCardInfo("Krav, the Unredeemed", 4, Rarity.RARE, mage.cards.k.KravTheUnredeemed.class));
        cards.add(new SetCardInfo("Land Tax", 94, Rarity.MYTHIC, mage.cards.l.LandTax.class));
        cards.add(new SetCardInfo("Last Gasp", 147, Rarity.COMMON, mage.cards.l.LastGasp.class));
        cards.add(new SetCardInfo("Last One Standing", 76, Rarity.RARE, mage.cards.l.LastOneStanding.class));
        cards.add(new SetCardInfo("Lava-Field Overlord", 60, Rarity.UNCOMMON, mage.cards.l.LavaFieldOverlord.class));
        cards.add(new SetCardInfo("Lead by Example", 205, Rarity.COMMON, mage.cards.l.LeadByExample.class));
        cards.add(new SetCardInfo("Ley Weaver", 21, Rarity.UNCOMMON, mage.cards.l.LeyWeaver.class));
        cards.add(new SetCardInfo("Lightning Talons", 180, Rarity.COMMON, mage.cards.l.LightningTalons.class));
        cards.add(new SetCardInfo("Lightwalker", 95, Rarity.COMMON, mage.cards.l.Lightwalker.class));
        cards.add(new SetCardInfo("Liturgy of Blood", 148, Rarity.COMMON, mage.cards.l.LiturgyOfBlood.class));
        cards.add(new SetCardInfo("Long Road Home", 96, Rarity.UNCOMMON, mage.cards.l.LongRoadHome.class));
        cards.add(new SetCardInfo("Lore Weaver", 22, Rarity.UNCOMMON, mage.cards.l.LoreWeaver.class));
        cards.add(new SetCardInfo("Loyal Pegasus", 97, Rarity.UNCOMMON, mage.cards.l.LoyalPegasus.class));
        cards.add(new SetCardInfo("Luxury Suite", 82, Rarity.RARE, mage.cards.l.LuxurySuite.class));
        cards.add(new SetCardInfo("Magma Hellion", 61, Rarity.COMMON, mage.cards.m.MagmaHellion.class));
        cards.add(new SetCardInfo("Magmatic Force", 181, Rarity.RARE, mage.cards.m.MagmaticForce.class));
        cards.add(new SetCardInfo("Magus of the Candelabra", 206, Rarity.RARE, mage.cards.m.MagusOfTheCandelabra.class));
        cards.add(new SetCardInfo("Mangara of Corondor", 98, Rarity.RARE, mage.cards.m.MangaraOfCorondor.class));
        cards.add(new SetCardInfo("Midnight Guard", 99, Rarity.COMMON, mage.cards.m.MidnightGuard.class));
        cards.add(new SetCardInfo("Millennial Gargoyle", 239, Rarity.COMMON, mage.cards.m.MillennialGargoyle.class));
        cards.add(new SetCardInfo("Mind's Eye", 240, Rarity.RARE, mage.cards.m.MindsEye.class));
        cards.add(new SetCardInfo("Mindblade Render", 49, Rarity.RARE, mage.cards.m.MindbladeRender.class));
        cards.add(new SetCardInfo("Morbid Curiosity", 149, Rarity.UNCOMMON, mage.cards.m.MorbidCuriosity.class));
        cards.add(new SetCardInfo("Morphic Pool", 83, Rarity.RARE, mage.cards.m.MorphicPool.class));
        cards.add(new SetCardInfo("Mountain", 253, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Mycosynth Lattice", 241, Rarity.MYTHIC, mage.cards.m.MycosynthLattice.class));
        cards.add(new SetCardInfo("Mystic Confluence", 122, Rarity.RARE, mage.cards.m.MysticConfluence.class));
        cards.add(new SetCardInfo("Najeela, the Blade-Blossom", 62, Rarity.MYTHIC, mage.cards.n.NajeelaTheBladeBlossom.class));
        cards.add(new SetCardInfo("Negate", 123, Rarity.COMMON, mage.cards.n.Negate.class));
        cards.add(new SetCardInfo("Night Market Guard", 242, Rarity.COMMON, mage.cards.n.NightMarketGuard.class));
        cards.add(new SetCardInfo("Nimbus Champion", 37, Rarity.UNCOMMON, mage.cards.n.NimbusChampion.class));
        cards.add(new SetCardInfo("Nimbus of the Isles", 124, Rarity.COMMON, mage.cards.n.NimbusOfTheIsles.class));
        cards.add(new SetCardInfo("Nirkana Revenant", 150, Rarity.MYTHIC, mage.cards.n.NirkanaRevenant.class));
        cards.add(new SetCardInfo("Noosegraf Mob", 151, Rarity.RARE, mage.cards.n.NoosegrafMob.class));
        cards.add(new SetCardInfo("Noxious Dragon", 152, Rarity.UNCOMMON, mage.cards.n.NoxiousDragon.class));
        cards.add(new SetCardInfo("Nyxathid", 153, Rarity.RARE, mage.cards.n.Nyxathid.class));
        cards.add(new SetCardInfo("Okaun, Eye of Chaos", 6, Rarity.RARE, mage.cards.o.OkaunEyeOfChaos.class));
        cards.add(new SetCardInfo("Omenspeaker", 125, Rarity.COMMON, mage.cards.o.Omenspeaker.class));
        cards.add(new SetCardInfo("Opportunity", 126, Rarity.UNCOMMON, mage.cards.o.Opportunity.class));
        cards.add(new SetCardInfo("Oracle's Insight", 127, Rarity.UNCOMMON, mage.cards.o.OraclesInsight.class));
        cards.add(new SetCardInfo("Oreskos Explorer", 100, Rarity.UNCOMMON, mage.cards.o.OreskosExplorer.class));
        cards.add(new SetCardInfo("Out of Bounds", 38, Rarity.UNCOMMON, mage.cards.o.OutOfBounds.class));
        cards.add(new SetCardInfo("Pacifism", 101, Rarity.COMMON, mage.cards.p.Pacifism.class));
        cards.add(new SetCardInfo("Painful Lesson", 154, Rarity.COMMON, mage.cards.p.PainfulLesson.class));
        cards.add(new SetCardInfo("Pathmaker Initiate", 182, Rarity.COMMON, mage.cards.p.PathmakerInitiate.class));
        cards.add(new SetCardInfo("Peace Strider", 243, Rarity.COMMON, mage.cards.p.PeaceStrider.class));
        cards.add(new SetCardInfo("Peregrine Drake", 128, Rarity.UNCOMMON, mage.cards.p.PeregrineDrake.class));
        cards.add(new SetCardInfo("Phantom Warrior", 129, Rarity.UNCOMMON, mage.cards.p.PhantomWarrior.class));
        cards.add(new SetCardInfo("Pierce Strider", 244, Rarity.COMMON, mage.cards.p.PierceStrider.class));
        cards.add(new SetCardInfo("Pir's Whim", 73, Rarity.RARE, mage.cards.p.PirsWhim.class));
        cards.add(new SetCardInfo("Pir, Imaginative Rascal", 11, Rarity.RARE, mage.cards.p.PirImaginativeRascal.class));
        cards.add(new SetCardInfo("Plains", 250, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Plated Crusher", 207, Rarity.UNCOMMON, mage.cards.p.PlatedCrusher.class));
        cards.add(new SetCardInfo("Play of the Game", 29, Rarity.RARE, mage.cards.p.PlayOfTheGame.class));
        cards.add(new SetCardInfo("Prakhata Club Security", 155, Rarity.COMMON, mage.cards.p.PrakhataClubSecurity.class));
        cards.add(new SetCardInfo("Primal Huntbeast", 208, Rarity.COMMON, mage.cards.p.PrimalHuntbeast.class));
        cards.add(new SetCardInfo("Proud Mentor", 20, Rarity.UNCOMMON, mage.cards.p.ProudMentor.class));
        cards.add(new SetCardInfo("Pulse of Murasa", 209, Rarity.UNCOMMON, mage.cards.p.PulseOfMurasa.class));
        cards.add(new SetCardInfo("Quest for the Gravelord", 156, Rarity.UNCOMMON, mage.cards.q.QuestForTheGravelord.class));
        cards.add(new SetCardInfo("Raptor Companion", 102, Rarity.COMMON, mage.cards.r.RaptorCompanion.class));
        cards.add(new SetCardInfo("Rebuke", 103, Rarity.COMMON, mage.cards.r.Rebuke.class));
        cards.add(new SetCardInfo("Reckless Reveler", 183, Rarity.COMMON, mage.cards.r.RecklessReveler.class));
        cards.add(new SetCardInfo("Reckless Scholar", 130, Rarity.UNCOMMON, mage.cards.r.RecklessScholar.class));
        cards.add(new SetCardInfo("Regna's Sanction", 30, Rarity.RARE, mage.cards.r.RegnasSanction.class));
        cards.add(new SetCardInfo("Regna, the Redeemer", 3, Rarity.RARE, mage.cards.r.RegnaTheRedeemer.class));
        cards.add(new SetCardInfo("Relentless Hunter", 226, Rarity.UNCOMMON, mage.cards.r.RelentlessHunter.class));
        cards.add(new SetCardInfo("Return to the Earth", 210, Rarity.COMMON, mage.cards.r.ReturnToTheEarth.class));
        cards.add(new SetCardInfo("Rhox Brute", 227, Rarity.COMMON, mage.cards.r.RhoxBrute.class));
        cards.add(new SetCardInfo("Riptide Crab", 228, Rarity.COMMON, mage.cards.r.RiptideCrab.class));
        cards.add(new SetCardInfo("Rotfeaster Maggot", 157, Rarity.COMMON, mage.cards.r.RotfeasterMaggot.class));
        cards.add(new SetCardInfo("Rowan Kenrith", 2, Rarity.MYTHIC, mage.cards.r.RowanKenrith.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Rowan Kenrith", 256, Rarity.MYTHIC, mage.cards.r.RowanKenrith.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Royal Trooper", 104, Rarity.COMMON, mage.cards.r.RoyalTrooper.class));
        cards.add(new SetCardInfo("Rushblade Commander", 77, Rarity.UNCOMMON, mage.cards.r.RushbladeCommander.class));
        cards.add(new SetCardInfo("Saddleback Lagac", 211, Rarity.COMMON, mage.cards.s.SaddlebackLagac.class));
        cards.add(new SetCardInfo("Saltwater Stalwart", 39, Rarity.COMMON, mage.cards.s.SaltwaterStalwart.class));
        cards.add(new SetCardInfo("Savage Ventmaw", 229, Rarity.UNCOMMON, mage.cards.s.SavageVentmaw.class));
        cards.add(new SetCardInfo("Screeching Buzzard", 158, Rarity.COMMON, mage.cards.s.ScreechingBuzzard.class));
        cards.add(new SetCardInfo("Sea of Clouds", 84, Rarity.RARE, mage.cards.s.SeaOfClouds.class));
        cards.add(new SetCardInfo("Seedborn Muse", 212, Rarity.RARE, mage.cards.s.SeedbornMuse.class));
        cards.add(new SetCardInfo("Seer's Lantern", 245, Rarity.COMMON, mage.cards.s.SeersLantern.class));
        cards.add(new SetCardInfo("Sentinel Tower", 79, Rarity.RARE, mage.cards.s.SentinelTower.class));
        cards.add(new SetCardInfo("Shambling Ghoul", 159, Rarity.COMMON, mage.cards.s.ShamblingGhoul.class));
        cards.add(new SetCardInfo("Shock", 184, Rarity.COMMON, mage.cards.s.Shock.class));
        cards.add(new SetCardInfo("Shoulder to Shoulder", 105, Rarity.COMMON, mage.cards.s.ShoulderToShoulder.class));
        cards.add(new SetCardInfo("Sickle Dancer", 50, Rarity.COMMON, mage.cards.s.SickleDancer.class));
        cards.add(new SetCardInfo("Silverchase Fox", 106, Rarity.COMMON, mage.cards.s.SilverchaseFox.class));
        cards.add(new SetCardInfo("Skyshroud Claim", 213, Rarity.COMMON, mage.cards.s.SkyshroudClaim.class));
        cards.add(new SetCardInfo("Skystreamer", 31, Rarity.COMMON, mage.cards.s.Skystreamer.class));
        cards.add(new SetCardInfo("Slum Reaper", 160, Rarity.UNCOMMON, mage.cards.s.SlumReaper.class));
        cards.add(new SetCardInfo("Soaring Show-Off", 40, Rarity.COMMON, mage.cards.s.SoaringShowOff.class));
        cards.add(new SetCardInfo("Solemn Offering", 107, Rarity.UNCOMMON, mage.cards.s.SolemnOffering.class));
        cards.add(new SetCardInfo("Soulblade Corrupter", 17, Rarity.UNCOMMON, mage.cards.s.SoulbladeCorrupter.class));
        cards.add(new SetCardInfo("Soulblade Renewer", 18, Rarity.UNCOMMON, mage.cards.s.SoulbladeRenewer.class));
        cards.add(new SetCardInfo("Sower of Temptation", 131, Rarity.RARE, mage.cards.s.SowerOfTemptation.class));
        cards.add(new SetCardInfo("Sparring Mummy", 108, Rarity.COMMON, mage.cards.s.SparringMummy.class));
        cards.add(new SetCardInfo("Spectral Searchlight", 246, Rarity.UNCOMMON, mage.cards.s.SpectralSearchlight.class));
        cards.add(new SetCardInfo("Spell Snare", 132, Rarity.UNCOMMON, mage.cards.s.SpellSnare.class));
        cards.add(new SetCardInfo("Spellseeker", 41, Rarity.RARE, mage.cards.s.Spellseeker.class));
        cards.add(new SetCardInfo("Spellweaver Duo", 42, Rarity.COMMON, mage.cards.s.SpellweaverDuo.class));
        cards.add(new SetCardInfo("Spire Garden", 85, Rarity.RARE, mage.cards.s.SpireGarden.class));
        cards.add(new SetCardInfo("Stadium Vendors", 63, Rarity.COMMON, mage.cards.s.StadiumVendors.class));
        cards.add(new SetCardInfo("Steppe Glider", 109, Rarity.UNCOMMON, mage.cards.s.SteppeGlider.class));
        cards.add(new SetCardInfo("Stolen Strategy", 64, Rarity.RARE, mage.cards.s.StolenStrategy.class));
        cards.add(new SetCardInfo("Stone Golem", 247, Rarity.COMMON, mage.cards.s.StoneGolem.class));
        cards.add(new SetCardInfo("Stunning Reversal", 51, Rarity.MYTHIC, mage.cards.s.StunningReversal.class));
        cards.add(new SetCardInfo("Swamp", 252, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Swarm of Bloodflies", 161, Rarity.UNCOMMON, mage.cards.s.SwarmOfBloodflies.class));
        cards.add(new SetCardInfo("Switcheroo", 133, Rarity.UNCOMMON, mage.cards.s.Switcheroo.class));
        cards.add(new SetCardInfo("Swords to Plowshares", 110, Rarity.UNCOMMON, mage.cards.s.SwordsToPlowshares.class));
        cards.add(new SetCardInfo("Sylvia Brightspear", 10, Rarity.RARE, mage.cards.s.SylviaBrightspear.class));
        cards.add(new SetCardInfo("Take Up Arms", 111, Rarity.UNCOMMON, mage.cards.t.TakeUpArms.class));
        cards.add(new SetCardInfo("Tandem Tactics", 112, Rarity.COMMON, mage.cards.t.TandemTactics.class));
        cards.add(new SetCardInfo("Tavern Swindler", 162, Rarity.UNCOMMON, mage.cards.t.TavernSwindler.class));
        cards.add(new SetCardInfo("Tenacious Dead", 163, Rarity.UNCOMMON, mage.cards.t.TenaciousDead.class));
        cards.add(new SetCardInfo("The Crowd Goes Wild", 68, Rarity.UNCOMMON, mage.cards.t.TheCrowdGoesWild.class));
        cards.add(new SetCardInfo("Thrasher Brute", 52, Rarity.UNCOMMON, mage.cards.t.ThrasherBrute.class));
        cards.add(new SetCardInfo("Thrilling Encore", 53, Rarity.RARE, mage.cards.t.ThrillingEncore.class));
        cards.add(new SetCardInfo("Thunder Strike", 185, Rarity.COMMON, mage.cards.t.ThunderStrike.class));
        cards.add(new SetCardInfo("Tidespout Tyrant", 134, Rarity.RARE, mage.cards.t.TidespoutTyrant.class));
        cards.add(new SetCardInfo("Together Forever", 32, Rarity.RARE, mage.cards.t.TogetherForever.class));
        cards.add(new SetCardInfo("Toothy, Imaginary Friend", 12, Rarity.RARE, mage.cards.t.ToothyImaginaryFriend.class));
        cards.add(new SetCardInfo("Totally Lost", 135, Rarity.COMMON, mage.cards.t.TotallyLost.class));
        cards.add(new SetCardInfo("True-Name Nemesis", 136, Rarity.MYTHIC, mage.cards.t.TrueNameNemesis.class));
        cards.add(new SetCardInfo("Trumpet Blast", 186, Rarity.UNCOMMON, mage.cards.t.TrumpetBlast.class));
        cards.add(new SetCardInfo("Tyrant's Machine", 248, Rarity.COMMON, mage.cards.t.TyrantsMachine.class));
        cards.add(new SetCardInfo("Unflinching Courage", 230, Rarity.UNCOMMON, mage.cards.u.UnflinchingCourage.class));
        cards.add(new SetCardInfo("Urborg Drake", 231, Rarity.COMMON, mage.cards.u.UrborgDrake.class));
        cards.add(new SetCardInfo("Vampire Charmseeker", 78, Rarity.UNCOMMON, mage.cards.v.VampireCharmseeker.class));
        cards.add(new SetCardInfo("Veteran Explorer", 214, Rarity.UNCOMMON, mage.cards.v.VeteranExplorer.class));
        cards.add(new SetCardInfo("Victory Chimes", 80, Rarity.RARE, mage.cards.v.VictoryChimes.class));
        cards.add(new SetCardInfo("Vigor", 215, Rarity.RARE, mage.cards.v.Vigor.class));
        cards.add(new SetCardInfo("Virtus the Veiled", 7, Rarity.RARE, mage.cards.v.VirtusTheVeiled.class));
        cards.add(new SetCardInfo("Virtus's Maneuver", 54, Rarity.RARE, mage.cards.v.VirtussManeuver.class));
        cards.add(new SetCardInfo("Wandering Wolf", 216, Rarity.COMMON, mage.cards.w.WanderingWolf.class));
        cards.add(new SetCardInfo("War's Toll", 187, Rarity.RARE, mage.cards.w.WarsToll.class));
        cards.add(new SetCardInfo("Watercourser", 137, Rarity.COMMON, mage.cards.w.Watercourser.class));
        cards.add(new SetCardInfo("Will Kenrith", 1, Rarity.MYTHIC, mage.cards.w.WillKenrith.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Will Kenrith", 255, Rarity.MYTHIC, mage.cards.w.WillKenrith.class, NON_FULL_USE_VARIOUS));
        cards.add(new SetCardInfo("Wrap in Flames", 188, Rarity.COMMON, mage.cards.w.WrapInFlames.class));
        cards.add(new SetCardInfo("Yotian Soldier", 249, Rarity.COMMON, mage.cards.y.YotianSoldier.class));
        cards.add(new SetCardInfo("Zndrsplt's Judgment", 43, Rarity.RARE, mage.cards.z.ZndrspltsJudgment.class));
        cards.add(new SetCardInfo("Zndrsplt, Eye of Wisdom", 5, Rarity.RARE, mage.cards.z.ZndrspltEyeOfWisdom.class));
    }

    @Override
    public List<Card> tryBooster() {
        List<Card> booster = new ArrayList<>();
        boolean partnerAllowed = true;
        List<CardInfo> uncommons = getCardsByRarity(Rarity.UNCOMMON);
        for (int i = 0; i < numBoosterUncommon; i++) {
            while (true) {
                addToBooster(booster, uncommons);
                int check = addMissingPartner(booster, partnerAllowed, numBoosterUncommon - 1, i);
                if (check == 1) {
                    break;
                }
                if (check == 2) {
                    partnerAllowed = false;
                    // Be sure to account for the added card
                    if (i != numBoosterUncommon - 1) {
                        i += 1;
                    }
                    break;
                }
            }
        }
        List<CardInfo> commons = getCardsByRarity(Rarity.COMMON);
        for (int i = 0; i < numBoosterCommon; i++) {
            addToBooster(booster, commons);
        }
        List<CardInfo> rares = getCardsByRarity(Rarity.RARE);
        List<CardInfo> mythics = getCardsByRarity(Rarity.MYTHIC);

        List<CardInfo> basicLands = getCardsByRarity(Rarity.LAND);
        for (int i = 0; i < numBoosterLands; i++) {
            addToBooster(booster, basicLands);
        }
        return booster;
    }

    private int addMissingPartner(List<Card> booster, boolean partnerAllowed, int max, int i) {
        Card sourceCard = booster.get(booster.size() - 1);
        for (Ability ability : sourceCard.getAbilities()) {
            // Check if fetched card has the PartnerWithAbility
            if (ability instanceof PartnerWithAbility) {
                String partnerName = ((PartnerWithAbility) ability).getPartnerName();
                // Check if the pack already contains a partner pair
                if (partnerAllowed) {
                    // Added card always replaces an uncommon card
                    Card card = CardRepository.instance.findCardWPreferredSet(partnerName, sourceCard.getExpansionSetCode(), false).getCard();
                    if (i < max) {
                        booster.add(card);
                    } else {
                        booster.set(0, card);
                    }
                    // 2 return value indicates found partner
                    return 2;
                } else {
                    // If partner already exists, remove card and loop again
                    booster.remove(booster.size() - 1);
                    return 0;
                }
            }
        }
        return 1;
    }
}