Example usage for java.util.stream Stream count

List of usage examples for java.util.stream Stream count

Introduction

In this page you can find the example usage for java.util.stream Stream count.

Prototype

long count();

Source Link

Document

Returns the count of elements in this stream.

Usage

From source file:org.semanticweb.owlapi6.api.test.fileroundtrip.FileRoundTripSubClassOfUntypedOWLClassStrictTestCase.java

@Test
public void testAxioms() throws OWLOntologyCreationException {
    config = config.setStrict(true);//w  w  w . j a  v a2  s .  c  o  m
    StreamDocumentSource documentSource = new StreamDocumentSource(
            getClass().getResourceAsStream('/' + fileName));
    OWLOntology ont = m1.loadOntologyFromOntologyDocument(documentSource, config);
    assertEquals(0, ont.axioms(AxiomType.SUBCLASS_OF).count());
    OWLDocumentFormat format = ont.getFormat();
    assertTrue(format instanceof RDFXMLDocumentFormat);
    assertTrue(documentSource.getOntologyLoaderMetaData().isPresent());
    Stream<Triple> triples = documentSource.getOntologyLoaderMetaData().get().getUnparsedTriples();
    assertEquals(1, triples.count());
}