int value = 10; assertThat(value, greaterThan(5));
double result = calculateTotalAmount(2, 3); assertThat(result, greaterThan(9.99));
ListIn this example, we are asserting that the size of the `list` is greater than 2. The org.hamcrest.Matchers.greaterThan matcher is part of the Hamcrest framework, which is a library of matchers for testing code in Java.list = Arrays.asList("apple", "banana", "cherry"); assertThat(list.size(), greaterThan(2));