@Test public void getFindTokenTest() throws IOException { short version = 0; Random random = new Random(); long latestBlobUpdateTime = random.nextLong(); long bytesRead = random.nextLong(); Set<String> lastReadBlobIds = new HashSet<>(); lastReadBlobIds.add("blobid1"); lastReadBlobIds.add("blobid2"); CosmosUpdateTimeFindToken cosmosUpdateTimeFindToken1 = new CosmosUpdateTimeFindToken(version, latestBlobUpdateTime, bytesRead, lastReadBlobIds); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(cosmosUpdateTimeFindToken1.toBytes())); CosmosUpdateTimeFindToken cosmosUpdateTimeFindToken2 = (CosmosUpdateTimeFindToken) new CosmosUpdateTimeFindTokenFactory().getFindToken(stream); assertEquals("incorrect token returned from factory", cosmosUpdateTimeFindToken1, cosmosUpdateTimeFindToken2); }
@Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosUpdateTimeFindToken.fromBytes(stream); }
CosmosUpdateTimeFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosUpdateTimeFindToken.fromBytes(stream); } }
CosmosUpdateTimeFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosUpdateTimeFindToken.fromBytes(stream); }  }
CosmosUpdateTimeFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosUpdateTimeFindToken.fromBytes(stream); }  @Override FindToken getFindToken(DataInputStream stream); @Override FindToken getNewFindToken(); }
CosmosUpdateTimeFindTokenFactory implements FindTokenFactory { @Override public FindToken getFindToken(DataInputStream stream) throws IOException { return CosmosUpdateTimeFindToken.fromBytes(stream); }  @Override FindToken getFindToken(DataInputStream stream); @Override FindToken getNewFindToken();  }