// Path: driver/src/com/leandog/brazenhead/commands/Command.java
// public class Command {
// 
//     private String name;
//     private Object[] arguments;
//     private Target target;
//     private String variable;
// 
//     public enum Target {
//         LastResultOrRobotium, Robotium, Brazenhead,
//     }
// 
//     public Command() {
//         name = null;
//         arguments = new Object[0];
//         target = Target.LastResultOrRobotium;
//     }
// 
//     public Command(final String name) {
//         this();
//         this.name = name;
//     }
// 
//     public Command(final String name, final Object... arguments) {
//         this();
//         this.name = name;
//         this.arguments = arguments;
//     }
//     
//     public Command(final String name, final Target target, final Object... arguments) {
//         this();
//         this.name = name;
//         this.arguments = arguments;
//         setTarget(target);
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Object[] getArguments() {
//         return arguments;
//     }
// 
//     public Target getTarget() {
//         return target;
//     }
// 
//     public String variableName() {
//         return variable;
//     }
// 
//     public void setVariable(final String variable) {
//         if( null != variable && !variable.matches("@@.*@@")) {
//             throw new IllegalVariableArgumentException();
//         }
//         this.variable = variable;
//     }
// 
//     public void setTarget(final Target target) {
//         if (target != null) {
//             this.target = target;
//         }
//     }
// 
//     public boolean hasVariable() {
//         return variable != null;
//     }
// 
//     public String getVariable() {
//         return variable;
//     }
// 
//     @Override
//     public int hashCode() {
//         return name.hashCode() + Arrays.hashCode(arguments);
//     }
// 
//     @Override
//     public boolean equals(Object other) {
//         if (null == other || !(other instanceof Command)) {
//             return false;
//         }
// 
//         final Command otherCommand = (Command) other;
//         return Objects.equal(name, otherCommand.getName()) && Arrays.equals(arguments, otherCommand.getArguments());
//     }
// }
// 
// Path: driver/src/com/leandog/brazenhead/commands/Command.java
// public enum Target {
//     LastResultOrRobotium, Robotium, Brazenhead,
// }
// 
// Path: driver/src/com/leandog/brazenhead/exceptions/IllegalVariableArgumentException.java
// public class IllegalVariableArgumentException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
//     
//     public IllegalVariableArgumentException() {
//         super("Variable names must be in the form of '@@some_name@@'.");
//     }
// 
// }


import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.experimental.theories.*;
import org.junit.runner.RunWith;
import com.leandog.brazenhead.commands.Command;
import com.leandog.brazenhead.commands.Command.Target;
import com.leandog.brazenhead.exceptions.IllegalVariableArgumentException;
package com.leandog.brazenhead.commands;




@RunWith(Theories.class)
public class CommandTest {

    @Test
    public void itSetsTheAppropriateDefaultsForTheCommand() {
        final Command theCommand = new Command();
        assertThat(theCommand.getName(), is(nullValue()));
        assertThat(theCommand.getArguments(), is(new Object[0]));
    }

    @Test
    public void itConsidersTheNameInTheHash() {
        final Command firstCommand = new Command("command");
        final Command sameCommand = new Command("command");
        assertThat(firstCommand.hashCode(), is(sameCommand.hashCode()));
    }

    @Test
    public void itConsidersTheArgumentsInTheHash() {
        final Command firstCommand = new Command("command", 1, "hello");
        final Command sameCommand = new Command("command", 1, "hello");
        assertThat(firstCommand.hashCode(), is(sameCommand.hashCode()));
    }

// Path: driver/src/com/leandog/brazenhead/commands/Command.java
// public class Command {
// 
//     private String name;
//     private Object[] arguments;
//     private Target target;
//     private String variable;
// 
//     public enum Target {
//         LastResultOrRobotium, Robotium, Brazenhead,
//     }
// 
//     public Command() {
//         name = null;
//         arguments = new Object[0];
//         target = Target.LastResultOrRobotium;
//     }
// 
//     public Command(final String name) {
//         this();
//         this.name = name;
//     }
// 
//     public Command(final String name, final Object... arguments) {
//         this();
//         this.name = name;
//         this.arguments = arguments;
//     }
//     
//     public Command(final String name, final Target target, final Object... arguments) {
//         this();
//         this.name = name;
//         this.arguments = arguments;
//         setTarget(target);
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Object[] getArguments() {
//         return arguments;
//     }
// 
//     public Target getTarget() {
//         return target;
//     }
// 
//     public String variableName() {
//         return variable;
//     }
// 
//     public void setVariable(final String variable) {
//         if( null != variable && !variable.matches("@@.*@@")) {
//             throw new IllegalVariableArgumentException();
//         }
//         this.variable = variable;
//     }
// 
//     public void setTarget(final Target target) {
//         if (target != null) {
//             this.target = target;
//         }
//     }
// 
//     public boolean hasVariable() {
//         return variable != null;
//     }
// 
//     public String getVariable() {
//         return variable;
//     }
// 
//     @Override
//     public int hashCode() {
//         return name.hashCode() + Arrays.hashCode(arguments);
//     }
// 
//     @Override
//     public boolean equals(Object other) {
//         if (null == other || !(other instanceof Command)) {
//             return false;
//         }
// 
//         final Command otherCommand = (Command) other;
//         return Objects.equal(name, otherCommand.getName()) && Arrays.equals(arguments, otherCommand.getArguments());
//     }
// }
// 
// Path: driver/src/com/leandog/brazenhead/commands/Command.java
// public enum Target {
//     LastResultOrRobotium, Robotium, Brazenhead,
// }
// 
// Path: driver/src/com/leandog/brazenhead/exceptions/IllegalVariableArgumentException.java
// public class IllegalVariableArgumentException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
//     
//     public IllegalVariableArgumentException() {
//         super("Variable names must be in the form of '@@some_name@@'.");
//     }
// 
// }


// Path: units/src/com/leandog/brazenhead/commands/CommandTest.java
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.experimental.theories.*;
import org.junit.runner.RunWith;
import com.leandog.brazenhead.commands.Command;
import com.leandog.brazenhead.commands.Command.Target;
import com.leandog.brazenhead.exceptions.IllegalVariableArgumentException;

package com.leandog.brazenhead.commands;




@RunWith(Theories.class)
public class CommandTest {

    @Test
    public void itSetsTheAppropriateDefaultsForTheCommand() {
        final Command theCommand = new Command();
        assertThat(theCommand.getName(), is(nullValue()));
        assertThat(theCommand.getArguments(), is(new Object[0]));
    }

    @Test
    public void itConsidersTheNameInTheHash() {
        final Command firstCommand = new Command("command");
        final Command sameCommand = new Command("command");
        assertThat(firstCommand.hashCode(), is(sameCommand.hashCode()));
    }

    @Test
    public void itConsidersTheArgumentsInTheHash() {
        final Command firstCommand = new Command("command", 1, "hello");
        final Command sameCommand = new Command("command", 1, "hello");
        assertThat(firstCommand.hashCode(), is(sameCommand.hashCode()));
    }

    @Test