@Test public void getFindTokenTest() throws IOException { short version = 0; Random random = new Random(); long bytesRead = random.nextLong(); String startContinuationToken = "start"; String endContinuationToken = "end"; int totalItems = random.nextInt(); int index = random.nextInt() % totalItems; String azureRequestId = UUID.randomUUID().toString(); CosmosChangeFeedFindToken cosmosChangeFeedFindToken1 = new CosmosChangeFeedFindToken(bytesRead, startContinuationToken, endContinuationToken, index, totalItems, azureRequestId, version); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(cosmosChangeFeedFindToken1.toBytes())); CosmosChangeFeedFindToken cosmosChangeFeedFindToken2 = (CosmosChangeFeedFindToken) new CosmosChangeFeedFindTokenFactory().getFindToken(stream); assertEquals("incorrect token returned from factory", cosmosChangeFeedFindToken1, cosmosChangeFeedFindToken2); }
@Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosChangeFeedFindToken.fromBytes(stream); }
CosmosChangeFeedFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosChangeFeedFindToken.fromBytes(stream); } }
CosmosChangeFeedFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosChangeFeedFindToken.fromBytes(stream); }  }
CosmosChangeFeedFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosChangeFeedFindToken.fromBytes(stream); }  @Override FindToken getFindToken(DataInputStream stream); @Override FindToken getNewFindToken(); }
CosmosChangeFeedFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosChangeFeedFindToken.fromBytes(stream); }  @Override FindToken getFindToken(DataInputStream stream); @Override FindToken getNewFindToken();  }