StoppedState extends ComponentStateImp { public static StoppedState getInstance() { if (instance == null) { instance = new StoppedState(); } return instance; } private  StoppedState(); @Override void requestStart(StateManagedComponent comp); @Override void requestClose(StateManagedComponent comp); @Override void requestInit(StateManagedComponent comp); static StoppedState getInstance();  }
@Test public void testInstance() throws Exception { StoppedState one = StoppedState.getInstance(); assertTrue(one == StoppedState.getInstance()); assertEquals(StoppedState.getInstance(), one); assertEquals(StoppedState.class.getSimpleName(), one.toString()); }