Base abstractions and templates for value classes for Java