Search tool in Java