Add test for method overwrites

@mirichi could you please review this patch?