Use diamond operator
[jFCPlib.git] / src / test / java / net / pterodactylus / fcp / fake / FakeTcpServer.java
index 6b3674a..67a1fdc 100644 (file)
@@ -31,12 +31,9 @@ public class FakeTcpServer implements AutoCloseable {
        }
 
        public Future<?> connect() throws IOException {
-               return executorService.submit(new Callable<Void>() {
-                       @Override
-                       public Void call() throws Exception {
-                               clientSocket.set(new TextSocket(serverSocket.accept()));
-                               return null;
-                       }
+               return executorService.submit(() -> {
+                       clientSocket.set(new TextSocket(serverSocket.accept()));
+                       return null;
                });
        }
 
@@ -44,8 +41,10 @@ public class FakeTcpServer implements AutoCloseable {
                return clientSocket.get().collectUntil(lineMatcher);
        }
 
-       public void writeLine(String line) throws IOException {
-               clientSocket.get().writeLine(line);
+       public void writeLine(String... lines) throws IOException {
+               for (String line : lines) {
+                       clientSocket.get().writeLine(line);
+               }
        }
 
        public String readLine() throws IOException {