@Test public void setEnabled() throws IOException { Servo servo = new Servo(mPwm); servo.setEnabled(true); Mockito.verify(mPwm).setEnabled(true); servo.setEnabled(false); Mockito.verify(mPwm).setEnabled(false); }
public void setEnabled(boolean enabled) throws IOException { if (mPwm == null) { throw new IllegalStateException("pwm device not opened"); } mPwm.setEnabled(enabled); }
Servo implements AutoCloseable { public void setEnabled(boolean enabled) throws IOException { if (mPwm == null) { throw new IllegalStateException("pwm device not opened"); } mPwm.setEnabled(enabled); } }
Servo implements AutoCloseable { public void setEnabled(boolean enabled) throws IOException { if (mPwm == null) { throw new IllegalStateException("pwm device not opened"); } mPwm.setEnabled(enabled); } Servo(String pin);  Servo(String pin, double frequencyHz); @VisibleForTesting  Servo(Pwm device); @VisibleForTesting  Servo(Pwm device, double frequencyHz); }
Servo implements AutoCloseable { public void setEnabled(boolean enabled) throws IOException { if (mPwm == null) { throw new IllegalStateException("pwm device not opened"); } mPwm.setEnabled(enabled); } Servo(String pin);  Servo(String pin, double frequencyHz); @VisibleForTesting  Servo(Pwm device); @VisibleForTesting  Servo(Pwm device, double frequencyHz); @Override void close(); void setEnabled(boolean enabled); void setPulseDurationRange(double minMs, double maxMs); double getMinimumPulseDuration(); double getMaximumPulseDuration(); void setAngleRange(double minAngle, double maxAngle); double getMinimumAngle(); double getMaximumAngle(); void setAngle(double angle); double getAngle(); }
Servo implements AutoCloseable { public void setEnabled(boolean enabled) throws IOException { if (mPwm == null) { throw new IllegalStateException("pwm device not opened"); } mPwm.setEnabled(enabled); } Servo(String pin);  Servo(String pin, double frequencyHz); @VisibleForTesting  Servo(Pwm device); @VisibleForTesting  Servo(Pwm device, double frequencyHz); @Override void close(); void setEnabled(boolean enabled); void setPulseDurationRange(double minMs, double maxMs); double getMinimumPulseDuration(); double getMaximumPulseDuration(); void setAngleRange(double minAngle, double maxAngle); double getMinimumAngle(); double getMaximumAngle(); void setAngle(double angle); double getAngle(); static final double DEFAULT_FREQUENCY_HZ; }