added tests for build/finalName and fix java-gem case