public class EncapsulationTest {
@Test (expected = IllegalStateException.class)
public void modifyEncapsulatedObject_viaTheEncapsulator() {
ArmEncapsulator encapsulator = Arm.armWeight(10);
encapsulator.asArm();
// Trying to modify state after encapsulation.
encapsulator.withArmLength(20);
}