V1FilterableIndex extends Freezable implements IndexSegment { @NotNull @Override public IndexSegment addDocument( final int documentId, @NotNull final Collection<UnsignedByteArray> values) { if (documentId < 0) throw new IllegalArgumentException("Negative document ID"); if (values.isEmpty()) throw new IllegalArgumentException("No values"); checkNotFrozen(); for (UnsignedByteArray value : values) { valueToDocuments.put(value, documentId); } return this; } V1FilterableIndex(
            @NotNull
            final String fieldName,
            final boolean fixedLength);  V1FilterableIndex(
            @NotNull
            final String fieldName,
            final boolean fixedLength,
            final boolean useTrie); @NotNull @Override IndexSegment addDocument(
            final int documentId,
            @NotNull
            final Collection<UnsignedByteArray> values); @Override void setDatabaseDocumentsCount(final int documentsCount); @NotNull @Override OutputStreamWritable buildWritable();  }
@Test public void addDocument() { new V1FilterableIndex("field", true) .addDocument( 0, Collections.singletonList(from(0))); }
@Test(expected = IllegalArgumentException.class) public void wrongDocument() { new V1FilterableIndex("field", true) .addDocument( -1, Collections.singletonList(from(0))); }
@Test(expected = IllegalArgumentException.class) public void emptyValues() { new V1FilterableIndex("field", true) .addDocument( 0, Collections.<UnsignedByteArray>emptyList()); }