phoneContextCtrl.expectAndReturn(phoneContext.getPhoneDefaults(), defaults, MockControl.ONE_OR_MORE);
    public void testFindByUsername() {        DeviceDefaults defaults = new DeviceDefaults();        defaults.setDomainName("sipfoundry.org");        MockControl phoneContextCtrl = MockControl.createControl(PhoneContext.class);        PhoneContext phoneContext = (PhoneContext) phoneContextCtrl.getMock();        phoneContextCtrl.expectAndReturn(phoneContext.getPhoneDefaults(), defaults, MockControl.ONE_OR_MORE);        phoneContextCtrl.replay();        Phone phone = new AcmePhone();        phone.setPhoneContext(phoneContext);        phone.setSerialNumber("123456789012");        Line l = phone.createLine();        User u = new User();        u.setUserName("foo");        l.setUser(u);        phone.addLine(l);                assertSame(l, phone.findByUsername("foo"));        assertNull(phone.findByUsername("foox"));                assertNull(phone.findByUsername("Foo"));                phoneContextCtrl.verify();    }