There is a java implementation given here https://github.com/kevalmorabia97/FPARM-Frequent-Patterns-and-Association-Rule-Miner. you can set your associations using it.
There are several example algorithms given here that may be worth looking at for your algorithm design https://en.wikipedia.org/wiki/Association_rule_learning