@Test
public void testToggle() {

    SwitchItem item = new SwitchItem();
    item.setTitle("TestTitle");
    item.setSummary("TestSummary");
    View view = createLayout();
    item.setChecked(true);
    item.onBindView(view);
    assertTrue("Switch should be checked", mSwitch.isChecked());
    item.toggle(view);
    assertFalse("Switch should be unchecked", mSwitch.isChecked());
}