ShardUtils { public static boolean isCollectionSharded(Map<String, Selector> options) throws ExecutionException { boolean isSharded = false; if (options != null) { Selector selectorSharded = options.get(SHARDING_ENABLED.getOptionName()); if (selectorSharded != null) { isSharded = SelectorHelper.getValue(Boolean.class, selectorSharded); } } return isSharded; } private  ShardUtils(); static boolean isCollectionSharded(Map<String, Selector> options); static void shardCollection(MongoClient mongoClient, TableMetadata tableMetadata);  }
@Test public void isCollectionShardedTest() throws ExecutionException { Map<String, Selector> options; options = new HashMap<>(); Assert.assertFalse("The result should be false by default", ShardUtils.isCollectionSharded(options)); options.put(TableOptions.SHARDING_ENABLED.getOptionName(), new BooleanSelector(true)); Assert.assertTrue("The result should be true", ShardUtils.isCollectionSharded(options)); options.put(TableOptions.SHARDING_ENABLED.getOptionName(), new StringSelector("true")); Assert.assertTrue("The result should be true", ShardUtils.isCollectionSharded(options)); }