The essence of generative programming in C++ is not templates -- the language feature -- but rather the underlying algorithms in the compiler (template instantiation) which unintentionally resemble an optimization called partial evaluation. By devising a partial evaluator for Java, we reproduce some of the generative programming aspects of C++ templates, without extending the Java language. The prototype compiler, called Lunar, is capable of doing ``expression templates'' in Java to optimize numerical array objects.