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