class ReflectionUtil {

    static boolean isSetter(Class<?> type, Method method) {
        if (method.getParameterCount() != 1) {
            // setter can only have a single parameter
            return false;
        }
        if (method.isAnnotationPresent(Value.class)) {
            // explicitly annotated with our Value annotation
            return true;
        }

        // we must ignore methods from Object itself
        if (method.getDeclaringClass().equals(Object.class)) {
            return false;
        }

        // we either look for "void setSometing(T t)" or "void something(T t)"
        if (method.getReturnType().equals(void.class)) {
            return true;
        }

        // Fluent API approach (return this or a new instance of the class)
        return method.getReturnType().equals(type);
    }

    private  ReflectionUtil();

}