question: private String changeExtension ( String fileName , String extension ) { if ( fileName == null ) { return null ; } int lastIndexOf = fileName . lastIndexOf ( "." ) ; return lastIndexOf != - 1 ? fileName . substring ( 0 , lastIndexOf + 1 ) + extension : fileName + "." + extension ; }
target:  Replaces extension if there is any