SystemFollowProfile implements StateProfile { @Override public void onStateUpdateFromItem(State state) { if (!(state instanceof Command)) { logger.debug("The given state {} could not be transformed to a command", state); return; } Command command = (Command) state; callback.handleCommand(command); } SystemFollowProfile(ProfileCallback callback); @Override ProfileTypeUID getProfileTypeUID(); @Override void onStateUpdateFromItem(State state); @Override void onCommandFromHandler(Command command); @Override void onCommandFromItem(Command command); @Override void onStateUpdateFromHandler(State state);  }
@Test public void testOnUpdate() { SystemFollowProfile profile = new SystemFollowProfile(mockCallback); profile.onStateUpdateFromItem(OnOffType.ON); verify(mockCallback).handleCommand(eq(OnOffType.ON)); verifyNoMoreInteractions(mockCallback); }