Abstract algebra for Java