We provide an algorithm to test the law of aggregate demand with runtime complexity polynomial to the length of the agent’s preference relation over a set of contracts. Access to this preference relation is essential, as we show that any algorithms with only oracle access to the agent’s choice function require a number of queries exponential to the number of contracts.