`@Configuration` marks a class that defines Spring beans. `@Bean` marks a method whose return value should be managed by Spring as a bean (created, injected, lifecycle handled).
@Configuration
class AppConfig {
@Bean
Clock clock() {
return Clock.systemUTC();
}
}