AbstractSetStateCommand extends AbstractAtCommand { @Override public String getOperands() { int enabledInt = enabled ? 1 : 0; return operandPrefix + enabledInt; } AbstractSetStateCommand(String operandPrefix, boolean enabled); @Override String getOperands();  }
@Test protected void constructorShouldSetStateOff() throws Exception { String expectedOperands = getOperandPrefix() + "0"; sut = createCommand(false); String operands = sut.getOperands(); assertThat(operands).isEqualTo(expectedOperands); }
@Test protected void constructorShouldSetStateOn() throws Exception { String expectedOperands = getOperandPrefix() + "1"; sut = createCommand(true); String operands = sut.getOperands(); assertThat(operands).isEqualTo(expectedOperands); }