diff --git a/common/src/main/java/io/netty/util/UniqueName.java b/common/src/main/java/io/netty/util/UniqueName.java index 5b60e331a4..4de43bd60f 100644 --- a/common/src/main/java/io/netty/util/UniqueName.java +++ b/common/src/main/java/io/netty/util/UniqueName.java @@ -103,7 +103,7 @@ public class UniqueName implements Comparable { return returnCode; } - return ((Integer) id).compareTo((Integer) other.id); + return ((Integer) id).compareTo(other.id); } @Override diff --git a/common/src/test/java/io/netty/util/NetworkConstantsTest.java b/common/src/test/java/io/netty/util/NetworkConstantsTest.java index 46321d8bb6..695cd5a768 100644 --- a/common/src/test/java/io/netty/util/NetworkConstantsTest.java +++ b/common/src/test/java/io/netty/util/NetworkConstantsTest.java @@ -15,10 +15,11 @@ */ package io.netty.util; +import static org.junit.Assert.*; + import java.net.InetAddress; import java.net.UnknownHostException; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; + import org.junit.Test; public class NetworkConstantsTest { @@ -30,7 +31,7 @@ public class NetworkConstantsTest { } @Test - public void testLoopback() throws UnknownHostException { + public void testLoopback() { assertNotNull(NetworkConstants.LOOPBACK_IF); } diff --git a/common/src/test/java/io/netty/util/UniqueNameTest.java b/common/src/test/java/io/netty/util/UniqueNameTest.java index cfba9046e0..fe65e87190 100644 --- a/common/src/test/java/io/netty/util/UniqueNameTest.java +++ b/common/src/test/java/io/netty/util/UniqueNameTest.java @@ -15,12 +15,11 @@ */ package io.netty.util; +import static org.junit.Assert.*; + import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertSame; + import org.junit.Before; import org.junit.Test; @@ -31,7 +30,7 @@ public class UniqueNameTest { * This is set up before each test */ private ConcurrentHashMap names; - + /** * Registers a {@link UniqueName} * @@ -44,30 +43,30 @@ public class UniqueNameTest { @Before public void initializeTest() { - this.names = new ConcurrentHashMap(); + names = new ConcurrentHashMap(); } @Test(expected=NullPointerException.class) public void testCannnotProvideNullMap() { - UniqueName nullName = new UniqueName(null, "Nothing"); + new UniqueName(null, "Nothing"); } @Test(expected=NullPointerException.class) public void testCannotProvideNullName() { - UniqueName nullName = new UniqueName(this.names, null); + new UniqueName(names, null); } @Test public void testArgsCanBePassed() { - UniqueName nullName = new UniqueName(this.names, "Argh, matey!", 2, 5, new Object()); + new UniqueName(names, "Argh, matey!", 2, 5, new Object()); } @Test public void testRegisteringName() { registerName("Abcedrian"); - assertTrue(this.names.get("Abcedrian")); - assertTrue(this.names.get("Hellyes") == null); + assertTrue(names.get("Abcedrian")); + assertTrue(names.get("Hellyes") == null); } @Test @@ -103,7 +102,7 @@ public class UniqueNameTest { } } } - + @Test public void testCompareNames() { UniqueName one = registerName("One");