RowkeyQueryStatement implements Statement<QueryResult<?>> { @Override public <I> QueryResult<?> execute(DataStorage<I> dataStorage) throws IOException { return dataStorage.queryById((List<I>) this.rowkeys,this.entityDefinition); } RowkeyQueryStatement(String rowkey,EntityDefinition entityDefinition);  RowkeyQueryStatement(String rowkey,String serviceName);  RowkeyQueryStatement(List<String> rowkeys,EntityDefinition entityDefinition);  RowkeyQueryStatement(List<String> rowkeys,String serviceName); @Override QueryResult<?> execute(DataStorage<I> dataStorage);  }
@Test public void testRowkeyExecute() throws Exception { String rowkey = "rowkey"; List<String> rowkeys = new ArrayList<>(); rowkeys.add(rowkey); EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestTimeSeriesAPIEntity.class); RowkeyQueryStatement rowkeyQueryStatement1 = new RowkeyQueryStatement(rowkey, entityDefinition); RowkeyQueryStatement rowkeyQueryStatement2 = new RowkeyQueryStatement(rowkey, TestTimeSeriesAPIEntity.class.getSimpleName()); RowkeyQueryStatement rowkeyQueryStatement3 = new RowkeyQueryStatement(rowkeys, entityDefinition); RowkeyQueryStatement rowkeyQueryStatement4 = new RowkeyQueryStatement(rowkeys, TestTimeSeriesAPIEntity.class.getSimpleName()); rowkeyQueryStatement1.execute(mockDataStorage); rowkeyQueryStatement2.execute(mockDataStorage); rowkeyQueryStatement3.execute(mockDataStorage); rowkeyQueryStatement4.execute(mockDataStorage); verify(mockDataStorage, times(4)).queryById(any(), any()); }