Form { public void display(Bundle bundle) { if (bundle != null && bundleSMapper != null) bundleSMapper.mapForward(bundle, source); if (drain.getDrain() != null) mapper.mapBackward(drain, source); } protected  Form(Builder<S, D> builder); void display(Bundle bundle); void display(); boolean save(); void forceSave(); boolean save(Bundle bundle); void forceSave(Bundle bundle);  }
@Test public void testDisplay() throws Exception { AuthModelSource source = new AuthModelSource(null); Form form = new Form.Builder<>(source, new AuthModelDrain(null), mapper).build(); form.display(); assertNotNull(source.getSource()); assertNull(source.getSource().email); assertNull(source.getSource().password); }
@Test public void testDisplayWithBundle() throws Exception { AuthModelSource source = new AuthModelSource(null); Form form = new Form.Builder<>(source, new AuthModelDrain(null), mapper) .withSourceExtrasMapper(bundleAuthModelSourceMapper).build(); form.display(bundle); assertNotNull(source.getSource()); assertEquals(EMAIL, source.getSource().email); assertEquals(PASSWORD, source.getSource().password); }