when(service.getInputs()).thenReturn(inputCollection);
Input input = mock(Input.class);
when(service.open(anyInt())).thenReturn(socket);
when(inputCollection.get(anyString())).thenReturn(input);
when(indexColl.get(anyString())).thenReturn(index);
when(index.attach(isA(Args.class))).thenReturn(socket);
when(socket.getOutputStream()).thenReturn(System.out);
} catch (IOException e) {
throw new RuntimeException(e);
}
}