definition and tests for abelian groups