Buggy code:
public class CheckGroupTest extends WicketTestCase { public CheckGroupTest ( String name ) { } public static class MockModelObject implements Serializable { private static final long serialVersionUID = 1L ; private Set < String > prop1 = new HashSet < String > ( ) ; private String prop2 ; public Set < String > getProp1 ( ) { } public void setProp1 ( Set < String > prop1 ) { } public String getProp2 ( ) { } public void setProp2 ( String prop2 ) { } } public void testFormProcessing ( ) { final String check1 = "check1-selection" ; final String check2 = "check2-selection" ; CheckGroupTest . MockModelObject modelObject = new CheckGroupTest . MockModelObject ( ) ; modelObject . setProp2 ( check2 ) ; List < CheckGroupTest . MockModelObject > list = new ArrayList < CheckGroupTest . MockModelObject > ( ) ; Model < Collection < CheckGroupTest . MockModelObject > > model = new Model < Collection < CheckGroupTest . MockModelObject > > ( list ) ; final CheckGroup group2 = new CheckGroup < CheckGroupTest . MockModelObject > ( new EmptyPage ( ) , "group2" , model ) ; assertTrue ( ( ( group2 . getModelObject ( ) ) == list ) ) ; final CheckGroup group3 = new CheckGroup < CheckGroupTest . MockModelObject > ( new EmptyPage ( ) , "group3" , list ) ; assertTrue ( ( ( group3 . getModelObject ( ) ) == list ) ) ; RequestCycle cycle = application . createRequestCycle ( ) ; MockPage page = new MockPage ( ) ; <START_BUG> final Form form = new Form ( page , "form" , new CompoundPropertyModel ( modelObject ) ) ; <END_BUG> final CheckGroup group = new CheckGroup ( form , "prop1" ) ; final WebMarkupContainer container = new WebMarkupContainer ( group , "container" ) ; final Check < String > choice1 = new Check < String > ( container , "check1" , new Model < String > ( check1 ) ) ; final Check choice2 = new Check ( group , "prop2" ) ; modelObject . getProp1 ( ) . add ( check1 ) ; form . onFormSubmitted ( ) ; assertTrue ( "running<seq2seq4repair_space>with<seq2seq4repair_space>nothing<seq2seq4repair_space>selected<seq2seq4repair_space>-<seq2seq4repair_space>model<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>empty" , ( ( modelObject . getProp1 ( ) . size ( ) ) == 0 ) ) ; application . getServletRequest ( ) . setParameter ( group . getInputName ( ) , choice1 . getPath ( ) ) ; form . onFormSubmitted ( ) ; assertTrue ( "running<seq2seq4repair_space>with<seq2seq4repair_space>choice1<seq2seq4repair_space>selected<seq2seq4repair_space>-<seq2seq4repair_space>model<seq2seq4repair_space>must<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>check1" , ( ( ( modelObject . getProp1 ( ) . size ( ) ) == 1 ) && ( modelObject . getProp1 ( ) . contains ( check1 ) ) ) ) ; application . getServletRequest ( ) . setParameter ( group . getInputName ( ) , choice2 . getPath ( ) ) ; form . onFormSubmitted ( ) ; assertTrue ( "running<seq2seq4repair_space>with<seq2seq4repair_space>choice2<seq2seq4repair_space>selected<seq2seq4repair_space>-<seq2seq4repair_space>model<seq2seq4repair_space>must<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>check2" , ( ( ( modelObject . getProp1 ( ) . size ( ) ) == 1 ) && ( modelObject . getProp1 ( ) . contains ( check2 ) ) ) ) ; application . getServletRequest ( ) . getParameterMap ( ) . put ( group . getInputName ( ) , new String [ ] { null , choice1 . getPath ( ) , null , choice2 . getPath ( ) } ) ; form . onFormSubmitted ( ) ; assertTrue ( "running<seq2seq4repair_space>with<seq2seq4repair_space>choice1<seq2seq4repair_space>and<seq2seq4repair_space>choice2<seq2seq4repair_space>selected<seq2seq4repair_space>-<seq2seq4repair_space>model<seq2seq4repair_space>must<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space>values<seq2seq4repair_space>of<seq2seq4repair_space>check1<seq2seq4repair_space>and<seq2seq4repair_space>check2" , ( ( ( ( modelObject . getProp1 ( ) . size ( ) ) == 2 ) && ( modelObject . getProp1 ( ) . contains ( check2 ) ) ) && ( modelObject . getProp1 ( ) . contains ( check1 ) ) ) ) ; application . getServletRequest ( ) . getParameterMap ( ) . put ( group . getInputName ( ) , new String [ ] { "some<seq2seq4repair_space>weird<seq2seq4repair_space>path<seq2seq4repair_space>to<seq2seq4repair_space>test<seq2seq4repair_space>error" } ) ; try { form . onFormSubmitted ( ) ; fail ( "running<seq2seq4repair_space>with<seq2seq4repair_space>an<seq2seq4repair_space>invalid<seq2seq4repair_space>choice<seq2seq4repair_space>value<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>request<seq2seq4repair_space>param,<seq2seq4repair_space>should<seq2seq4repair_space>fail" ) ; } catch ( WicketRuntimeException e ) { } } public void testRendering ( ) throws Exception { } }

Fix:
final Form form = new Form < CheckGroupTest . MockModelObject > ( page , "form" , new wicket . model . CompoundPropertyModel < CheckGroupTest . MockModelObject > ( modelObject ) ) ;