@SuppressWarnings( "PMD.CollapsibleIfStatements" )
    private <V extends FileAttributeView> V addIsLinkIfPossible( Class<V> type, V fav ) {
        if( BasicFileAttributeView.class.isAssignableFrom( type ) ) {
            if( (! v( () -> BasicFileAttributeView.class.cast( fav ).readAttributes()).isSymbolicLink() )) {
                if( !( fav instanceof LinkInfoSettable ) ) {
                    throw new UnsupportedOperationException( "the attribute view need to implement LinkInfoSettable in order to make SymLinks work" );
                }

                ( (LinkInfoSettable) ( fav ) ).setLink();
            }
        }

        return fav;
    }
@ SuppressWarnings ( "PMD.CollapsibleIfStatements" ) private < V extends FileAttributeView > V addIsLinkIfPossible ( Class < V > type , V fav ) { if ( BasicFileAttributeView . class . isAssignableFrom ( type ) ) { if ( ( ! v ( ( ) -> BasicFileAttributeView . class . cast ( fav ) . readAttributes ( ) ) . isSymbolicLink ( ) ) ) { if ( ! ( fav instanceof LinkInfoSettable ) ) { throw new UnsupportedOperationException ( "the attribute view need to implement LinkInfoSettable in order to make SymLinks work" ) ; } ( ( LinkInfoSettable ) ( fav ) ) . setLink ( ) ; } } return fav ; }
if the the FAV is actually a BasicFileAttributeView then there is an isLink method
if this is not already set and FAV implements LinkInfoSettable use it to add this link info