String message = "Hello, world!"; assertThat(message, instanceOf(String.class));
Listnames = new ArrayList<>(); assertThat(names, instanceOf(List.class));
MapThis code checks that the `mapping` variable is an instance of the `Map` class. The `instanceOf` matcher is part of the `org.hamcrest.CoreMatchers` class, which is included in the Hamcrest library.mapping = new HashMap<>(); assertThat(mapping, instanceOf(Map.class));