Localtest is a library for running local tests for SAP PI/PO java mappings and UDF. Add sources or jar file into your SAP PI java mapping project and you will be able to run it locally. UDFs are supported as well, see examples in package com.interace.samples
First of all you will need to add SAP PI libraries in the lib folder:
com.sap.xi.mapping.tool.lib_api.jar com.sap.xi.mapping.lib.jar
You can find these files in your SAP PI installation.