public void relatedMethodImplementations( )
{
Set<MethodEntry> entries;
// getName()
entries = m_index.getRelatedMethodImplementations( new MethodEntry( m_baseClass, "a", "()Ljava/lang/String;" ) );
assertThat( entries, containsInAnyOrder(
new MethodEntry( m_baseClass, "a", "()Ljava/lang/String;" ),
new MethodEntry( m_subClassAA, "a", "()Ljava/lang/String;" )
) );
entries = m_index.getRelatedMethodImplementations( new MethodEntry( m_subClassAA, "a", "()Ljava/lang/String;" ) );
assertThat( entries, containsInAnyOrder(
new MethodEntry( m_baseClass, "a", "()Ljava/lang/String;" ),
new MethodEntry( m_subClassAA, "a", "()Ljava/lang/String;" )
) );
// doBaseThings()
entries = m_index.getRelatedMethodImplementations( new MethodEntry( m_baseClass, "a", "()V" ) );
assertThat( entries, containsInAnyOrder(
new MethodEntry( m_baseClass, "a", "()V" ),
new MethodEntry( m_subClassAA, "a", "()V" ),
new MethodEntry( m_subClassB, "a", "()V" )
) );
entries = m_index.getRelatedMethodImplementations( new MethodEntry( m_subClassAA, "a", "()V" ) );
assertThat( entries, containsInAnyOrder(
new MethodEntry( m_baseClass, "a", "()V" ),
new MethodEntry( m_subClassAA, "a", "()V" ),
new MethodEntry( m_subClassB, "a", "()V" )
) );
entries = m_index.getRelatedMethodImplementations( new MethodEntry( m_subClassB, "a", "()V" ) );
assertThat( entries, containsInAnyOrder(
new MethodEntry( m_baseClass, "a", "()V" ),
new MethodEntry( m_subClassAA, "a", "()V" ),
new MethodEntry( m_subClassB, "a", "()V" )
) );
// doBThings
entries = m_index.getRelatedMethodImplementations( new MethodEntry( m_subClassB, "b", "()V" ) );
assertThat( entries, containsInAnyOrder(
new MethodEntry( m_subClassB, "b", "()V" )
) );
}