### Question:
StateMachine { public static <T> Builder<T> builder(String name) { return new Builder<T>(name); } private  StateMachine(String name,
      T initialState,
      Multimap<T, T> stateTransitions,
      Consumer<Transition<T>> transitionCallback,
      boolean throwOnBadTransition); String getName(); T getState(); void checkState(T expectedState); void checkState(Set<T> allowedStates); boolean transition(T nextState); static Builder<T> builder(String name);  }### Answer:
@Test public void testEmptySM() { control.replay(); try { StateMachine.builder(NAME).build(); fail(); } catch (IllegalStateException e) { } }
@Test public void testMachineNoInit() { control.replay(); try { StateMachine.<String>builder(NAME) .addState(Rule.from(A).to(B)) .build(); fail(); } catch (IllegalStateException e) { } }