Generic Java library for validation of constraints