gt: 		protected void setStartTime(long startTime) {
context: package org.impact2585.frc2016.tests;
  
  
  
  import org.impact2585.frc2016.input.InputMethod;
  import org.impact2585.frc2016.systems.IntakeSystem;
  import org.junit.Assert;
  import org.junit.Before;
  import org.junit.Test;
  
  /**
   * the test for the intake system
   */
  public class IntakeSystemTest {
  	private InputMethod input;
  	private boolean digitalMoveArmAwayFromBot;
  	private boolean digitalMoveArmTowardsBot;
  	private double analogMoveArmAwayFromBot;
  	private double analogMoveArmTowardsBot;
  	private boolean moveWheelsForward;
  	private boolean moveWheelsBackwards;
  	private TestIntakeSystem ioshooter;
  	private double wheelSpeed;
  	private double armSpeed;
  	private boolean toggleArmSpeed;
  	private boolean isLeftLimitSwitchClosed;
  	private boolean isRightLimitSwitchClosed;
  	private boolean isShootingSwitchClosed;
  	private boolean ignoreIntakeLimitSwitch;
  	private boolean shoot;
  	private boolean turnLeverReverse;
  	private double leverSpeed;
  	private boolean turnLeverForward;
  	private boolean manualIntake;
  	private double rightArmSpeed;
  	private double leftArmSpeed;
  	private double leftIntakeSpeed;
  	private double rightIntakeSpeed;
  	
  	
  	/**
  	 * sets up the intake system test
  	 */
  	@Before
  	public void setUp() {
  		ioshooter = new TestIntakeSystem();
  		input = new InputTest();
  		ioshooter.setInput(input);
  	}
  
  	/**
  	 * the tests to run for the intake system
  	 */
  	@Test
  	public void test() {
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 0);
  		
  		//tests if the shooter shoots
  		moveWheelsForward = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 1 && armSpeed == 0);
  		
  		//tests if the intake intakes
  		moveWheelsBackwards = true;
  		moveWheelsForward = false;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == -1 && armSpeed == 0);
  		
  		//tests if the wheels don't move if the person pushes both buttons
  		moveWheelsForward = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 0);
  		
  		//tests if the arms move forward
  		moveWheelsForward = false;
  		moveWheelsBackwards = false;
  		digitalMoveArmAwayFromBot = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == IntakeSystem.ARM_SPEED);
  		
  		//tests if the arms move backwards
  		digitalMoveArmAwayFromBot = false;
  		digitalMoveArmTowardsBot = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -IntakeSystem.ARM_SPEED);
  		
  		//tests if the arms don't move if the users pushes both buttons
  		digitalMoveArmAwayFromBot = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 0);
  		
  		//tests if the arms and the wheels can both move simultaneously
  		digitalMoveArmTowardsBot = false;
  		moveWheelsForward = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 1 && armSpeed == IntakeSystem.ARM_SPEED);
  		
  		//turn off the digital input
  		moveWheelsForward = false;
  		digitalMoveArmAwayFromBot = false;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 0);
  		
  		//tests if arms move away with the analog input
  		analogMoveArmAwayFromBot = 1;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == IntakeSystem.ARM_SPEED);
  		
  		//tests if the arms move towards the bot with analog input
  		analogMoveArmTowardsBot = 1;
  		analogMoveArmAwayFromBot = 0;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -IntakeSystem.ARM_SPEED);
  		
  		//tests if the arms don't move at all if Harris pushes both triggers
  		analogMoveArmAwayFromBot = 1;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 0);
  		
  		//tests if the input arms can move while the input runs
  		analogMoveArmAwayFromBot = 0;
  		moveWheelsForward = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 1 && armSpeed == -IntakeSystem.ARM_SPEED);
  		
  		//tests if the arm speed multiplier can be toggled off
  		toggleArmSpeed = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 1 && armSpeed == -1);
  		
  		//tests if the arm speed multiplier doesn't toggle if Harris keeps pushing the button
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 1 && armSpeed == -1);
  		
  		//tests if the arm speed multiplier toggles on
  		moveWheelsForward = false;
  		toggleArmSpeed = false;
  		ioshooter.run();
  		toggleArmSpeed = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -IntakeSystem.ARM_SPEED);
  		
  		//tests if the arm speed multiplier toggles off for digital input
  		toggleArmSpeed = false;
  		ioshooter.run();
  		analogMoveArmTowardsBot = 0;
  		digitalMoveArmTowardsBot = true;
  		toggleArmSpeed = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -1);
  		
  		//tests if the intake arms do not move forward if both limit switches are pressed
  		isLeftLimitSwitchClosed = true;
  		isRightLimitSwitchClosed = true;
  		digitalMoveArmTowardsBot = false;
  		analogMoveArmTowardsBot = 1;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 0);
  		
  		//tests if the intake arms do not move forward if only one limit switch is pressed and if the intake still works
  		moveWheelsForward = true;
  		isLeftLimitSwitchClosed = false;
  		analogMoveArmAwayFromBot = 0;
  		analogMoveArmTowardsBot = 1;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 1 && armSpeed == 0);
  		
  		//tests if the arms can move back if the limit switch is pressed
  		analogMoveArmAwayFromBot = 1;
  		analogMoveArmTowardsBot = 0;
  		moveWheelsForward = false;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == 1);
  		
  		//tests if the arms can move forward if the limit switch is no longer pressed
  		analogMoveArmTowardsBot = 0.7;
  		analogMoveArmAwayFromBot = 0;
  		isRightLimitSwitchClosed = false;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -analogMoveArmTowardsBot);
  		
  		//tests if the arms can move forward if both limit switches and x button are pressed
  		isLeftLimitSwitchClosed = true;
  		isRightLimitSwitchClosed = true;
  		ignoreIntakeLimitSwitch = true;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -analogMoveArmTowardsBot);
  		
  		//tests if the arms can move forward if one limit switch and the x button are pressed
  		isLeftLimitSwitchClosed = false;
  		ioshooter.run();
  		Assert.assertTrue(wheelSpeed == 0 && armSpeed == -analogMoveArmTowardsBot);
  		
  		//tests if the lever can automatically turn forward to shoot then reverse back after B button is pressed
  		shoot = true;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 1.0);
  		ioshooter.setStartTime(System.currentTimeMillis()-250);
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == -1.0);
  		
  		//tests that the lever stops moving after the time
  		ioshooter.setStartTime(System.currentTimeMillis() - 483);
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0);
  		
  		//tests the limit switch for the timed shoot
  		isShootingSwitchClosed = true;
  		ioshooter.setStartTime(System.currentTimeMillis() - 200);
  		shoot = true;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0);
  		
  		//tests if lever will turn in reverse if A button is pressed
  		shoot = false;
  		isShootingSwitchClosed = false;
  		turnLeverReverse = true;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == -0.5 );
  		
  		//tests if lever will not run if neither B nor A buttons are pressed
  		turnLeverReverse = false;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0);
  		
  		//tests if the lever will go forward if it gets forward input
  		turnLeverForward = true;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0.5);
  		
  		//tests if forward input can interrupt the timed lever
  		turnLeverForward = false;
  		shoot = true;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 1);
  		turnLeverForward = true;
  		shoot = false;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0.5);
  		turnLeverForward = false;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0);
  		
  		//tests if the limit switch is ignored for forward input
  		turnLeverForward = true;
  		isShootingSwitchClosed = true;
  		ioshooter.run();
  		Assert.assertTrue(leverSpeed == 0.5);
  		
  		//tests if manual intake control works
  		manualIntake = true;
  		rightArmSpeed = 0.5;
  		leftArmSpeed = 0.5;
  		ioshooter.run();
  		Assert.assertTrue(rightIntakeSpeed == 0.5);
  		Assert.assertTrue(leftIntakeSpeed == 0.5);
  		
  		//tests if manual intake can be disabled
  		manualIntake = false;
  		analogMoveArmAwayFromBot = 0;
  		analogMoveArmTowardsBot = 0;
  		digitalMoveArmAwayFromBot = false;
  		digitalMoveArmTowardsBot = false;
  		ioshooter.run();
  		Assert.assertTrue(armSpeed == 0);
  	}
  	
  	/**
  	 * A testable intake system
  	 */
  	private class TestIntakeSystem extends IntakeSystem{
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#spinWheels(double)
  		 */
  		@Override
  		public void spinWheels(double speed) {
  			wheelSpeed = speed;
  		}
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#moveArms(double)
  		 */
  		@Override
  		public void moveArms(double speed) {
  			armSpeed = speed;
  		}
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#isLeftSwitchClosed()
  		 */
  		@Override
  		public boolean isLeftSwitchClosed() {
  			return isLeftLimitSwitchClosed;
  		}
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#isRightSwitchClosed()
  		 */
  		@Override
  		public boolean isRightSwitchClosed() {
  			return isRightLimitSwitchClosed;
  		}
  		
  		
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#isShootingSwitchClosed()
  		 */
  		@Override
  		public boolean isShootingSwitchClosed() {
  			return isShootingSwitchClosed;
  		}
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#setInput(org.impact2585.frc2016.input.InputMethod)
  		 */
  		@Override
  		protected void setInput(InputMethod newInput) {
  			super.setInput(newInput);
  		}
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#spinLever(double)
  		 */
  		@Override
  		public void spinLever(double speed) {
  			leverSpeed = speed;
  		}
  
  		/* (non-Javadoc)
  		 * @see org.impact2585.frc2016.systems.IntakeSystem#setStartTime(long)
  		 */
  		@Override
  