Methods as Parameters: A Pre-processing Approach in Java