Buggy code:
public final String getString ( final String key ) { } public final String getString ( final String key , final IModel < ? > model ) { } public final String getString ( final String key , final IModel < ? > model , final String defaultValue ) { } public final String getStyle ( ) { } public String getVariation ( ) { } public final boolean hasBeenRendered ( ) { } public final boolean hasErrorMessage ( ) { } public final boolean hasFeedbackMessage ( ) { } public final void info ( final String message ) { } public final boolean isActionAuthorized ( Action action ) { } public final boolean isEnableAllowed ( ) { } public boolean isEnabled ( ) { } public final boolean isRenderAllowed ( ) { } public final boolean isStateless ( ) { } public boolean isVersioned ( ) { } public boolean isVisible ( ) { } public final boolean isVisibleInHierarchy ( ) { } public final void markRendering ( boolean setRenderingFlag ) { } public final void modelChanged ( ) { } public final void modelChanging ( ) { } public final void prepareForRender ( boolean setRenderingFlag ) { } public final void prepareForRender ( ) { } public final void redirectToInterceptPage ( final Page page ) { } public final void remove ( ) { } public Component remove ( final IBehavior behavior ) { } private boolean removeBehavior ( final IBehavior behavior ) { } public final void render ( ) { } private final void render_ ( ) { } private void onException ( final RuntimeException ex ) { } protected void renderPlaceholderTag ( final ComponentTag tag , final Response response ) { } public final void renderComponent ( ) { } private boolean needToRenderTag ( final ComponentTag openTag ) { } public final void rendered ( ) { } public void renderHead ( final HtmlHeaderContainer container ) { } public Component replaceWith ( Component replacement ) { } public final boolean sameInnermostModel ( final Component component ) { } public final boolean sameInnermostModel ( final IModel < ? > model ) { } public final Component setEnabled ( final boolean enabled ) { } public final Component setEscapeModelStrings ( final boolean escapeMarkup ) { } public final void setMarkupIdImpl ( Object markupId ) { } public Component setMarkupId ( String markupId ) { } public final < M > void setMetaData ( final MetaDataKey < M > key , final M object ) { } public Component setDefaultModel ( final IModel < ? > model ) { } IModel < ? > getModelImpl ( ) { } void setModelImpl ( IModel < ? > model ) { } @ SuppressWarnings ( "unchecked" ) public final Component setDefaultModelObject ( final Object object ) { } public final Component setOutputMarkupId ( final boolean output ) { } public final Component setOutputMarkupPlaceholderTag ( final boolean outputTag ) { } public final Component setRenderBodyOnly ( final boolean renderTag ) { } public final < C extends Page > void setResponsePage ( final Class < C > cls ) { } public final < C extends Page > void setResponsePage ( final Class < C > cls , PageParameters parameters ) { } public final void setResponsePage ( final Page page ) { } public Component setVersioned ( boolean versioned ) { } public final Component setVisible ( final boolean visible ) { } @ Override public String toString ( ) { } public String toString ( final boolean detailed ) { } public final < C extends Page > CharSequence urlFor ( final Class < C > pageClass , final PageParameters parameters ) { } public final CharSequence urlFor ( final IBehavior behaviour , final RequestListenerInterface listener ) { PageAndComponentProvider provider = new PageAndComponentProvider ( getPage ( ) , this ) ; <START_BUG> int index = getBehaviors ( ) . indexOf ( behaviour ) ; <END_BUG> IRequestHandler handler ; if ( getPage ( ) . isPageStateless ( ) ) { handler = new org . apache . wicket . ng . request . handler . impl . BookmarkableListenerInterfaceRequestHandler ( provider , listener , index ) ; } else { handler = new org . apache . wicket . ng . request . handler . impl . ListenerInterfaceRequestHandler ( provider , listener , index ) ; } return getRequestCycle ( ) . renderUrlFor ( handler ) ; } public final CharSequence urlFor ( final IRequestHandler requestHandler ) { } public final CharSequence urlFor ( final RequestListenerInterface listener ) { } public final CharSequence urlFor ( final ResourceReference resourceReference ) { } public final Object visitParents ( final Class < ? > c , final Component . IVisitor < Component > visitor ) { } public final void warn ( final String message ) { } private void notifyBehaviorsComponentBeforeRender ( ) { } private void notifyBehaviorsComponentRendered ( ) { } protected final void addStateChange ( ) { } protected final void checkComponentTag ( final ComponentTag tag , final String name ) { } protected final void checkComponentTagAttribute ( final ComponentTag tag , final String key , final String value ) { } protected void checkHierarchyChange ( final Component component ) { } protected void detachModel ( ) { } protected final String exceptionMessage ( final String message ) { } protected final MarkupStream findMarkupStream ( ) { } protected final Page findPage ( ) { } @ SuppressWarnings ( "unchecked" ) protected < M extends IBehavior > List < M > getBehaviors ( Class < M > type ) { } protected final boolean getFlag ( final int flag ) { } protected final boolean getFlag ( final short flag ) { } protected final IModel < ? > getInnermostModel ( final IModel < ? > model ) { } public IModelComparator getModelComparator ( ) { } protected boolean getStatelessHint ( ) { } @ SuppressWarnings ( "unchecked" ) protected IModel < ? > initModel ( ) { }

Fix:
int index = getBehaviorsRawList ( ) . indexOf ( behaviour ) ;