Testing entanglement