Runtime type casting required in ConnectClient.java