contains and endsWith functions, tests