class MethodUtil {

    private MethodUtil() { }

    /**
     * Invoke method and return double value.
     *
     * @param method target method
     * @param targetObj the object the underlying method is invoked from
     * @return result
     */
    public static double invokeAndReturnDouble(Method method, Object targetObj) {
        try {
            return method != null ? (double) method.invoke(targetObj) : -1;
        } catch (Exception e) {
            return -1;
        }
    }

    /**
     * Invoke method and return long value.
     *
     * @param method target method
     * @param targetObj the object the underlying method is invoked from
     * @return result
     */
    public static long invokeAndReturnLong(Method method, Object targetObj) {<FILL_FUNCTION_BODY>}
}

        try {
            return method != null ? (long) method.invoke(targetObj) : -1;
        } catch (Exception e) {
            return -1;
        }
    
<no_super_class>