Added generic isDivisible method.