class SystemCodeFindAllInternalBySystemCodeValuesKeyGenerator implements KeyGenerator {

    @Override
    @Nonnull
    public Object generate( @Nonnull Object target, @Nonnull Method method, @Nonnull Object... params )
    {
        @SuppressWarnings( "unchecked" ) final Collection<String> internalSystemUris = (Collection<String>) params[0];
        @SuppressWarnings( "unchecked" ) final Collection<String> otherSystemCodes = (Collection<String>) params[1];
        final StringBuilder sb = new StringBuilder( "findAllInternalBySystemCodeValues," );

        sb.append( internalSystemUris.size() );
        sb.append( ',' );
        sb.append( otherSystemCodes.size() );

        // must have same order every time
        for ( final String value : new TreeSet<>( internalSystemUris ) )
        {
            sb.append( ',' ).append( value );
        }

        // must have same order every time
        for ( final String value : new TreeSet<>( otherSystemCodes ) )
        {
            sb.append( ',' ).append( value );
        }

        return sb.toString();
    }

}