diff --git a/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java b/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java
index 956d83d8ec..5eceadd960 100644
--- a/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java
+++ b/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java
@@ -82,7 +82,7 @@ public static final class DestinationConfigurer {
 		}
 
 		public Binding to(FanoutExchange exchange) {
-			return new Binding(this.queue, this.name, this.type, exchange.getName(), "", new HashMap<String, Object>());
+			return new Binding(this.queue, this.name, this.type, exchange.getName(), "", new HashMap<>());
 		}
 
 		public HeadersExchangeMapConfigurer to(HeadersExchange exchange) {
diff --git a/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/listener/StreamListenerContainer.java b/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/listener/StreamListenerContainer.java
index 925565cb29..842ca8f071 100644
--- a/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/listener/StreamListenerContainer.java
+++ b/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/listener/StreamListenerContainer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,7 @@
  *
  * @author Gary Russell
  * @author Christian Tzolov
+ * @author Ngoc Nhan
  * @since 2.4
  *
  */
@@ -251,7 +252,7 @@ public void afterPropertiesSet() {
 	public boolean isRunning() {
 		this.lock.lock();
 		try {
-			return this.consumers.size() > 0;
+			return !this.consumers.isEmpty();
 		}
 		finally {
 			this.lock.unlock();
@@ -262,7 +263,7 @@ public boolean isRunning() {
 	public void start() {
 		this.lock.lock();
 		try {
-			if (this.consumers.size() == 0) {
+			if (this.consumers.isEmpty()) {
 				this.consumerCustomizer.accept(getListenerId(), this.builder);
 				if (this.simpleStream) {
 					this.consumers.add(this.builder.build());
diff --git a/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/support/converter/DefaultStreamMessageConverter.java b/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/support/converter/DefaultStreamMessageConverter.java
index dd2d765fd7..614f4a6e79 100644
--- a/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/support/converter/DefaultStreamMessageConverter.java
+++ b/spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/support/converter/DefaultStreamMessageConverter.java
@@ -41,6 +41,7 @@
  * Default {@link StreamMessageConverter}.
  *
  * @author Gary Russell
+ * @author Ngoc Nhan
  * @since 2.4
  *
  */
@@ -105,7 +106,7 @@ public com.rabbitmq.stream.Message fromMessage(Message message) throws MessageCo
 				.acceptIfNotNull(mProps.getGroupSequence(), propsBuilder::groupSequence)
 				.acceptIfNotNull(mProps.getReplyToGroupId(), propsBuilder::replyToGroupId);
 		ApplicationPropertiesBuilder appPropsBuilder = builder.applicationProperties();
-		if (mProps.getHeaders().size() > 0) {
+		if (!mProps.getHeaders().isEmpty()) {
 			mProps.getHeaders().forEach((key, val) -> {
 				mapProp(key, val, appPropsBuilder);
 			});
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/annotation/RabbitListenerAnnotationBeanPostProcessor.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/annotation/RabbitListenerAnnotationBeanPostProcessor.java
index 40f01b38bc..2c1ce24447 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/annotation/RabbitListenerAnnotationBeanPostProcessor.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/annotation/RabbitListenerAnnotationBeanPostProcessor.java
@@ -317,12 +317,12 @@ public Object postProcessAfterInitialization(final Object bean, final String bea
 
 	private TypeMetadata buildMetadata(Class<?> targetClass) {
 		List<RabbitListener> classLevelListeners = findListenerAnnotations(targetClass);
-		final boolean hasClassLevelListeners = classLevelListeners.size() > 0;
+		final boolean hasClassLevelListeners = !classLevelListeners.isEmpty();
 		final List<ListenerMethod> methods = new ArrayList<>();
 		final List<Method> multiMethods = new ArrayList<>();
 		ReflectionUtils.doWithMethods(targetClass, method -> {
 			List<RabbitListener> listenerAnnotations = findListenerAnnotations(method);
-			if (listenerAnnotations.size() > 0) {
+			if (!listenerAnnotations.isEmpty()) {
 				methods.add(new ListenerMethod(method,
 						listenerAnnotations.toArray(new RabbitListener[listenerAnnotations.size()])));
 			}
@@ -880,7 +880,7 @@ private Map<String, Object> resolveArguments(Argument[] arguments) {
 				}
 			}
 		}
-		return map.size() < 1 ? null : map;
+		return map.isEmpty() ? null : map;
 	}
 
 	private void addToMap(Map<String, Object> map, String key, Object value, Class<?> typeClass, String typeName) {
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/batch/SimpleBatchingStrategy.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/batch/SimpleBatchingStrategy.java
index 8958cac06c..a7f80b3d46 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/batch/SimpleBatchingStrategy.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/batch/SimpleBatchingStrategy.java
@@ -88,7 +88,7 @@ public MessageBatch addToBatch(String exch, String routKey, Message message) {
 		}
 		int bufferUse = Integer.BYTES + message.getBody().length;
 		MessageBatch batch = null;
-		if (this.messages.size() > 0 && this.currentSize + bufferUse > this.bufferLimit) {
+		if (!this.messages.isEmpty() && this.currentSize + bufferUse > this.bufferLimit) {
 			batch = doReleaseBatch();
 			this.exchange = exch;
 			this.routingKey = routKey;
@@ -104,7 +104,7 @@ public MessageBatch addToBatch(String exch, String routKey, Message message) {
 
 	@Override
 	public Date nextRelease() {
-		if (this.messages.size() == 0 || this.timeout <= 0) {
+		if (this.messages.isEmpty() || this.timeout <= 0) {
 			return null;
 		}
 		else if (this.currentSize >= this.bufferLimit) {
@@ -128,7 +128,7 @@ public Collection<MessageBatch> releaseBatches() {
 	}
 
 	private MessageBatch doReleaseBatch() {
-		if (this.messages.size() < 1) {
+		if (this.messages.isEmpty()) {
 			return null;
 		}
 		Message message = assembleMessage();
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/HeadersExchangeParser.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/HeadersExchangeParser.java
index fc38d35a90..0cb49dbab2 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/HeadersExchangeParser.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/HeadersExchangeParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
  * @author Dave Syer
  * @author Gary Russell
  * @author Artem Bilan
+ * @author Ngoc Nhan
  *
  */
 public class HeadersExchangeParser extends AbstractExchangeParser {
@@ -63,7 +64,7 @@ protected BeanDefinitionBuilder parseBinding(String exchangeName, Element bindin
 				parserContext.getReaderContext()
 						.error("At least one of 'binding-arguments' sub-element or 'key/value' attributes pair have to be declared.", binding);
 			}
-			ManagedMap<TypedStringValue, TypedStringValue> map = new ManagedMap<TypedStringValue, TypedStringValue>();
+			ManagedMap<TypedStringValue, TypedStringValue> map = new ManagedMap<>();
 			map.put(new TypedStringValue(key), new TypedStringValue(value));
 			builder.addPropertyValue("arguments", map);
 		}
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerFactoryBean.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerFactoryBean.java
index 0a070e1eca..c919105ea1 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerFactoryBean.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerFactoryBean.java
@@ -56,6 +56,7 @@
  * @author Artem Bilan
  * @author Johno Crawford
  * @author Jeonggi Kim
+ * @author Ngoc Nhan
  *
  * @since 2.0
  *
@@ -542,7 +543,7 @@ protected AbstractMessageListenerContainer createInstance() { // NOSONAR complex
 					.acceptIfNotNull(this.exclusiveConsumerExceptionLogger,
 							container::setExclusiveConsumerExceptionLogger)
 					.acceptIfNotNull(this.micrometerEnabled, container::setMicrometerEnabled)
-					.acceptIfCondition(this.micrometerTags.size() > 0, this.micrometerTags,
+					.acceptIfCondition(!this.micrometerTags.isEmpty(), this.micrometerTags,
 							container::setMicrometerTags);
 			if (this.smlcCustomizer != null && this.type.equals(Type.simple)) {
 				this.smlcCustomizer.configure((SimpleMessageListenerContainer) container);
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerParser.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerParser.java
index 0fb64b643c..fce31f9935 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerParser.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@
 /**
  * @author Mark Fisher
  * @author Gary Russell
+ * @author Ngoc Nhan
  * @since 1.0
  */
 class ListenerContainerParser implements BeanDefinitionParser {
@@ -188,7 +189,7 @@ private void parseListener(Element listenerEle, Element containerEle, ParserCont
 			}
 			else {
 				String[] names = StringUtils.commaDelimitedListToStringArray(queues);
-				List<RuntimeBeanReference> values = new ManagedList<RuntimeBeanReference>();
+				List<RuntimeBeanReference> values = new ManagedList<>();
 				for (int i = 0; i < names.length; i++) {
 					values.add(new RuntimeBeanReference(names[i].trim()));
 				}
@@ -196,14 +197,14 @@ private void parseListener(Element listenerEle, Element containerEle, ParserCont
 			}
 		}
 
-		ManagedMap<String, TypedStringValue> args = new ManagedMap<String, TypedStringValue>();
+		ManagedMap<String, TypedStringValue> args = new ManagedMap<>();
 
 		String priority = listenerEle.getAttribute("priority");
 		if (StringUtils.hasText(priority)) {
 			args.put("x-priority", new TypedStringValue(priority, Integer.class));
 		}
 
-		if (args.size() > 0) {
+		if (!args.isEmpty()) {
 			containerDef.getPropertyValues().add("consumerArguments", args);
 		}
 
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java
index 4bce257e1a..38314dad06 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@
  * @author Gary Russell
  * @author Felipe Gutierrez
  * @author Artem Bilan
+ * @author Ngoc Nhan
  *
  */
 public class QueueParser extends AbstractSingleBeanDefinitionParser {
@@ -134,7 +135,7 @@ private void parseArguments(Element element, ParserContext parserContext, BeanDe
 			Map<?, ?> map = parserContext.getDelegate().parseMapElement(argumentsElement,
 					builder.getRawBeanDefinition());
 			if (StringUtils.hasText(ref)) {
-				if (map != null && map.size() > 0) {
+				if (map != null && !map.isEmpty()) {
 					parserContext.getReaderContext()
 							.error("You cannot have both a 'ref' and a nested map", element);
 				}
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/RabbitNamespaceUtils.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/RabbitNamespaceUtils.java
index 69ba403406..c219c7bf7c 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/RabbitNamespaceUtils.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/RabbitNamespaceUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -358,28 +358,22 @@ public static BeanDefinition parseContainer(Element containerEle, ParserContext
 	}
 
 	private static AcknowledgeMode parseAcknowledgeMode(Element ele, ParserContext parserContext) {
-		AcknowledgeMode acknowledgeMode = null;
 		String acknowledge = ele.getAttribute(ACKNOWLEDGE_ATTRIBUTE);
 		if (StringUtils.hasText(acknowledge)) {
-			if (ACKNOWLEDGE_AUTO.equals(acknowledge)) {
-				acknowledgeMode = AcknowledgeMode.AUTO;
-			}
-			else if (ACKNOWLEDGE_MANUAL.equals(acknowledge)) {
-				acknowledgeMode = AcknowledgeMode.MANUAL;
-			}
-			else if (ACKNOWLEDGE_NONE.equals(acknowledge)) {
-				acknowledgeMode = AcknowledgeMode.NONE;
-			}
-			else {
-				parserContext.getReaderContext().error(
+			return switch (acknowledge) {
+				case ACKNOWLEDGE_AUTO -> AcknowledgeMode.AUTO;
+				case ACKNOWLEDGE_MANUAL -> AcknowledgeMode.MANUAL;
+				case ACKNOWLEDGE_NONE -> AcknowledgeMode.NONE;
+				default -> {
+					parserContext.getReaderContext().error(
 						"Invalid listener container 'acknowledge' setting [" + acknowledge
-								+ "]: only \"auto\", \"manual\", and \"none\" supported.", ele);
-			}
-			return acknowledgeMode;
-		}
-		else {
-			return null;
+							+ "]: only \"auto\", \"manual\", and \"none\" supported.", ele);
+					yield null;
+				}
+			};
 		}
+
+		return null;
 	}
 
 }
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/TemplateParser.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/TemplateParser.java
index 5259fa0e25..c9c5c3f908 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/TemplateParser.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/TemplateParser.java
@@ -34,6 +34,7 @@
  * @author Dave Syer
  * @author Gary Russell
  * @author Artem Bilan
+ * @author Ngoc Nhan
  */
 class TemplateParser extends AbstractSingleBeanDefinitionParser {
 
@@ -160,7 +161,7 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
 		BeanDefinition replyContainer = null;
 		Element childElement = null;
 		List<Element> childElements = DomUtils.getChildElementsByTagName(element, LISTENER_ELEMENT);
-		if (childElements.size() > 0) {
+		if (!childElements.isEmpty()) {
 			childElement = childElements.get(0);
 		}
 		if (childElement != null) {
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PublisherCallbackChannelImpl.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PublisherCallbackChannelImpl.java
index 12284d5bca..b8ee5e29dd 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PublisherCallbackChannelImpl.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PublisherCallbackChannelImpl.java
@@ -904,12 +904,12 @@ public int getPendingConfirmsCount() {
 	@Override
 	public void addListener(Listener listener) {
 		Assert.notNull(listener, "Listener cannot be null");
-		if (this.listeners.size() == 0) {
+		if (this.listeners.isEmpty()) {
 			this.delegate.addConfirmListener(this);
 			this.delegate.addReturnListener(this);
 		}
 		if (this.listeners.putIfAbsent(listener.getUUID(), listener) == null) {
-			this.pendingConfirms.put(listener, new ConcurrentSkipListMap<Long, PendingConfirm>());
+			this.pendingConfirms.put(listener, new ConcurrentSkipListMap<>());
 			if (this.logger.isDebugEnabled()) {
 				this.logger.debug("Added listener " + listener);
 			}
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/SimpleResourceHolder.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/SimpleResourceHolder.java
index f0861a0497..10036d3ad2 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/SimpleResourceHolder.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/SimpleResourceHolder.java
@@ -176,7 +176,7 @@ public static Object pop(Object key) {
 		Map<Object, Deque<Object>> stack = STACK.get();
 		if (stack != null) {
 			Deque<Object> deque = stack.get(key);
-			if (deque != null && deque.size() > 0) {
+			if (deque != null && !deque.isEmpty()) {
 				Object previousValue = deque.pop();
 				if (previousValue != null) {
 					bind(key, previousValue);
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/ThreadChannelConnectionFactory.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/ThreadChannelConnectionFactory.java
index d1b667532f..b9d371e683 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/ThreadChannelConnectionFactory.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/ThreadChannelConnectionFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,6 +49,7 @@
  * @author Gary Russell
  * @author Leonardo Ferreira
  * @author Christian Tzolov
+ * @author Ngoc Nhan
  * @since 2.3
  *
  */
@@ -191,7 +192,7 @@ public void destroy() {
 				this.connection.forceClose();
 				this.connection = null;
 			}
-			if (this.switchesInProgress.size() > 0 && this.logger.isWarnEnabled()) {
+			if (!this.switchesInProgress.isEmpty() && this.logger.isWarnEnabled()) {
 				this.logger.warn("Unclaimed context switches from threads:" +
 						this.switchesInProgress.values()
 								.stream()
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/BatchingRabbitTemplate.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/BatchingRabbitTemplate.java
index 8982d80986..18e0b11719 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/BatchingRabbitTemplate.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/BatchingRabbitTemplate.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2023 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -99,7 +99,7 @@ public void send(String exchange, String routingKey, Message message,
 				}
 				Date next = this.batchingStrategy.nextRelease();
 				if (next != null) {
-					this.scheduledTask = this.scheduler.schedule((Runnable) () -> releaseBatches(), next.toInstant());
+					this.scheduledTask = this.scheduler.schedule(this::releaseBatches, next.toInstant());
 				}
 			}
 		}
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/AbstractRabbitListenerEndpoint.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/AbstractRabbitListenerEndpoint.java
index 7ea93712fe..de0a38f538 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/AbstractRabbitListenerEndpoint.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/AbstractRabbitListenerEndpoint.java
@@ -397,8 +397,7 @@ public void setupListenerContainer(MessageListenerContainer listenerContainer) {
 				throw new IllegalStateException("Queues or queue names must be provided but not both for " + this);
 			}
 			if (queuesEmpty) {
-				Collection<String> names = qNames;
-				container.setQueueNames(names.toArray(new String[0]));
+				container.setQueueNames(qNames.toArray(new String[0]));
 			}
 			else {
 				Collection<Queue> instances = getQueues();
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/adapter/MessageListenerAdapter.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/adapter/MessageListenerAdapter.java
index c9c90a1871..65667d8453 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/adapter/MessageListenerAdapter.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/adapter/MessageListenerAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2022 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -118,6 +118,7 @@
  * @author Gary Russell
  * @author Greg Turnquist
  * @author Cai Kun
+ * @author Ngoc Nhan
  *
  * @see #setDelegate
  * @see #setDefaultListenerMethod
@@ -129,7 +130,7 @@
  */
 public class MessageListenerAdapter extends AbstractAdaptableMessageListener {
 
-	private final Map<String, String> queueOrTagToMethodName = new HashMap<String, String>();
+	private final Map<String, String> queueOrTagToMethodName = new HashMap<>();
 
 	/**
 	 * Out-of-the-box value for the default listener method: "handleMessage".
@@ -314,7 +315,7 @@ else if (delegateListener instanceof MessageListener messageListener) {
 	 * @see #setQueueOrTagToMethodName
 	 */
 	protected String getListenerMethodName(Message originalMessage, Object extractedMessage) {
-		if (this.queueOrTagToMethodName.size() > 0) {
+		if (!this.queueOrTagToMethodName.isEmpty()) {
 			MessageProperties props = originalMessage.getMessageProperties();
 			String methodName = this.queueOrTagToMethodName.get(props.getConsumerQueue());
 			if (methodName == null) {
diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/RepublishMessageRecoverer.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/RepublishMessageRecoverer.java
index ae84767aa3..61bb2122c7 100644
--- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/RepublishMessageRecoverer.java
+++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/RepublishMessageRecoverer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2022 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -91,7 +91,7 @@ public class RepublishMessageRecoverer implements MessageRecoverer {
 	 * @param errorTemplate the template.
 	 */
 	public RepublishMessageRecoverer(AmqpTemplate errorTemplate) {
-		this(errorTemplate, (String) null, (String) null);
+		this(errorTemplate, null, (String) null);
 	}
 
 	/**