Dynamo extends Observable { protected void newState(T newState) { setChanged(); mStateMachine.nextState(newState); notifyObservers(); }    }
@Test public void observerCalledOnSingleStateChange() { Dynamo dynamo = new Dynamo(){}; Observer observerMock = Mockito.mock(Observer.class); dynamo.addObserver(observerMock); dynamo.newState(Mockito.mock(StateMachine.State.class)); Mockito.verify(observerMock, Mockito.times(1)).update(Matchers.isA(Observable.class), Matchers.any()); }