🎨 Use method reference instead of anonymous class
[xudocci.git] / src / main / java / net / pterodactylus / irc / DefaultConnection.java
index 79ab87b..39908ef 100644 (file)
@@ -98,13 +98,7 @@ public class DefaultConnection extends AbstractExecutionThreadService implements
        private final int port;
 
        /** The nickname chooser. */
-       private NicknameChooser nicknameChooser = new NicknameChooser() {
-
-               @Override
-               public String getNickname() {
-                       return RandomNickname.get();
-               }
-       };
+       private NicknameChooser nicknameChooser = RandomNickname::get;
 
        /** The nickname. */
        private String nickname = null;