TextFactoryImpl implements TextFactory { public Text createText(String text) { return new TextImpl(text); } private  TextFactoryImpl(); static TextFactoryImpl getInstance(); Text createText(String text);  }
@Test public void testCreateText() { TextFactoryImpl textFactory = TextFactoryImpl.getInstance(); Text text = textFactory.createText("abc"); assertEquals(new TextImpl("abc"), text); }