void () { if (myComponent instanceof JList) moveHome((JList<?>)myComponent); else if (myComponent instanceof JTable) moveHome((JTable)myComponent); else throw new IllegalArgumentException("MoveHome is not implemented for " + myComponent.getClass()); }