BackendKeyUtils { static long percentageToToken(final float input) { final float r = Math.min(Math.max(input, 0.0f), 1.0f) * 2.0f; if (r < 1.0f) { return (long) (Long.MIN_VALUE * (1.0f - r)); } return (long) (Long.MAX_VALUE * (r - 1.0f)); } BackendKeyUtils(
        final String column, final String keyspace, final String table, final SchemaInstance schema
    ); SchemaBoundStatement selectKeys(final BackendKeyFilter filter);  }
@Test public void testFloatToToken() { assertEquals(Long.MAX_VALUE, BackendKeyUtils.percentageToToken(1.0f)); assertEquals(Long.MIN_VALUE, BackendKeyUtils.percentageToToken(0.0f)); assertEquals(0, BackendKeyUtils.percentageToToken(0.5f)); }