ReplaceModeConverter implements Converter { @Override public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object obj) { if (obj instanceof ReplaceMode) { return ((ReplaceMode) obj).name(); } return obj.toString(); }  @Override Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value); @Override String getAsString(FacesContext facesContext, UIComponent uiComponent, Object obj);  }
@Test public void testGetAsString_1() throws Exception { ReplaceModeConverter fixture = new ReplaceModeConverter(); FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent uiComponent = new DynaForm(); Object obj = ReplaceMode.KEY; String result = fixture.getAsString(facesContext, uiComponent, obj); assertNotNull(result); }