// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/PololuMaestroServoController.java
// public static PololuMaestroServoController pololuMaestroServoController(PololuMaestroServoCard card) {
// 	return new PololuMaestroServoController(card);
// }
// 
// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/usb/UsbPololuMaestroServoCards.java
// public static PololuMaestroServoCard defaultUsbPololuMaestroServoCard() {
// 	return usbPololuMaestroServoCard(Usb.device(isAMaestroUsbDevice()));
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/Servo.java
// public interface Servo extends AnalogIO, ServoFeatures<MutableDouble> {
// 
// 	/**
// 	 * Returns a proxy {@link Servo} that is two-way calibrated representation of this instance.
// 	 */
// 	default Servo calibrated(ServoCalibration calibration) {
// 		return new CalibratedServo(this, calibration);
// 	}
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoController.java
// public interface ServoController<C> extends AnalogIOController<C> {
// 	MutableDouble speed(C channelId);
// 	MutableDouble acceleration(C channelId);
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoSource.java
// public interface ServoSource<C> extends PerChannelSource<C, Servo> {
// 
// 	/**
// 	 * Returns a ServoSource that has new channel ids, as defined by the given function.
// 	 */
// 	default <NewServoId> ServoSource<NewServoId> remapped(Function<NewServoId, C> remapping) {
// 		return new RemappedServoSource<NewServoId, C>(this, remapping);
// 	}
// 
// 	/**
// 	 * Returns a ServoSource that returns calibrated proxies of the {@link Servo}s from another (target) {@link ServoSource}.
// 	 */
// 	default ServoSource<C> calibrated(ServoSourceCalibration<C> calibration) {
// 		return new CalibratedServoSource<C>(this, calibration);
// 	}
// 
// 	/**
// 	 * Returns a ServoSource that returns calibrated proxies of the {@link Servo}s from another (target) {@link ServoSource}.
// 	 */
// 	default ServoSource<C> calibrated(ServoCalibration calibration) {
// 		return calibrated(servoSourceCalibration(calibration));
// 	}
// 
// 	/**
// 	 * @return A {@link ServoSource} of {@link RawServo}s for the given {@link ServoController}.
// 	 */
// 	public static <C> ServoSource<C> rawServoSource(final ServoController<C> controller) {
// 		return new ServoSource<C>() {
// 			@Override
// 			public Servo forChannel(C channel) {
// 				return new RawServo<C>(controller, channel);
// 			}
// 		};
// 	}
// 
// }


import static com.iamcontent.device.controller.pololu.maestro.PololuMaestroServoController.pololuMaestroServoController;
import static com.iamcontent.device.controller.pololu.maestro.usb.UsbPololuMaestroServoCards.defaultUsbPololuMaestroServoCard;
import org.junit.Before;
import com.iamcontent.device.servo.Servo;
import com.iamcontent.device.servo.ServoController;
import com.iamcontent.device.servo.ServoSource;


	@Before
	public void setUp() {
		rawServoSource = rawServoSource();
	}

	@Override
	protected void setAcceleration(int channel, double acceleration) {
		getServo(channel).acceleration().setValue(acceleration);
	}

	@Override
	protected void setSpeed(int channel, double speed) {
		getServo(channel).speed().setValue(speed);
	}

	@Override
	protected void setPosition(int channel, double position) {
		getServo(channel).value().setValue(position);
	}

	@Override
	protected double getPosition(int channel) {
		return getServo(channel).value().getValue();
	}
	
	private Servo getServo(int channel) {
		return rawServoSource.forChannel(channel);
	}


// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/PololuMaestroServoController.java
// public static PololuMaestroServoController pololuMaestroServoController(PololuMaestroServoCard card) {
// 	return new PololuMaestroServoController(card);
// }
// 
// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/usb/UsbPololuMaestroServoCards.java
// public static PololuMaestroServoCard defaultUsbPololuMaestroServoCard() {
// 	return usbPololuMaestroServoCard(Usb.device(isAMaestroUsbDevice()));
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/Servo.java
// public interface Servo extends AnalogIO, ServoFeatures<MutableDouble> {
// 
// 	/**
// 	 * Returns a proxy {@link Servo} that is two-way calibrated representation of this instance.
// 	 */
// 	default Servo calibrated(ServoCalibration calibration) {
// 		return new CalibratedServo(this, calibration);
// 	}
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoController.java
// public interface ServoController<C> extends AnalogIOController<C> {
// 	MutableDouble speed(C channelId);
// 	MutableDouble acceleration(C channelId);
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoSource.java
// public interface ServoSource<C> extends PerChannelSource<C, Servo> {
// 
// 	/**
// 	 * Returns a ServoSource that has new channel ids, as defined by the given function.
// 	 */
// 	default <NewServoId> ServoSource<NewServoId> remapped(Function<NewServoId, C> remapping) {
// 		return new RemappedServoSource<NewServoId, C>(this, remapping);
// 	}
// 
// 	/**
// 	 * Returns a ServoSource that returns calibrated proxies of the {@link Servo}s from another (target) {@link ServoSource}.
// 	 */
// 	default ServoSource<C> calibrated(ServoSourceCalibration<C> calibration) {
// 		return new CalibratedServoSource<C>(this, calibration);
// 	}
// 
// 	/**
// 	 * Returns a ServoSource that returns calibrated proxies of the {@link Servo}s from another (target) {@link ServoSource}.
// 	 */
// 	default ServoSource<C> calibrated(ServoCalibration calibration) {
// 		return calibrated(servoSourceCalibration(calibration));
// 	}
// 
// 	/**
// 	 * @return A {@link ServoSource} of {@link RawServo}s for the given {@link ServoController}.
// 	 */
// 	public static <C> ServoSource<C> rawServoSource(final ServoController<C> controller) {
// 		return new ServoSource<C>() {
// 			@Override
// 			public Servo forChannel(C channel) {
// 				return new RawServo<C>(controller, channel);
// 			}
// 		};
// 	}
// 
// }


// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/test/java/com/iamcontent/device/controller/pololu/maestro/RawPololuMaestroServoSourceIT.java
import static com.iamcontent.device.controller.pololu.maestro.PololuMaestroServoController.pololuMaestroServoController;
import static com.iamcontent.device.controller.pololu.maestro.usb.UsbPololuMaestroServoCards.defaultUsbPololuMaestroServoCard;
import org.junit.Before;
import com.iamcontent.device.servo.Servo;
import com.iamcontent.device.servo.ServoController;
import com.iamcontent.device.servo.ServoSource;


	@Before
	public void setUp() {
		rawServoSource = rawServoSource();
	}

	@Override
	protected void setAcceleration(int channel, double acceleration) {
		getServo(channel).acceleration().setValue(acceleration);
	}

	@Override
	protected void setSpeed(int channel, double speed) {
		getServo(channel).speed().setValue(speed);
	}

	@Override
	protected void setPosition(int channel, double position) {
		getServo(channel).value().setValue(position);
	}

	@Override
	protected double getPosition(int channel) {
		return getServo(channel).value().getValue();
	}
	
	private Servo getServo(int channel) {
		return rawServoSource.forChannel(channel);
	}


	protected static ServoSource<Integer> rawServoSource() {
