Checks if {@code types} contain the given {@code type}