tiny template implementation of java