### Question:
VLogKnowledgeBase { boolean hasData() { return !this.edbPredicates.isEmpty() || !this.aliasedEdbPredicates.isEmpty(); } VLogKnowledgeBase(final KnowledgeBase knowledgeBase); boolean hasRules();  }### Answer:
@Test public void hasData_noData_returnsFalse() { VLogKnowledgeBase vKB = new VLogKnowledgeBase(knowledgeBase); assertFalse(vKB.hasData()); }
@Test public void hasData_noAliasedPredicates_returnsTrue() { knowledgeBase.addStatement(fact); VLogKnowledgeBase vKB = new VLogKnowledgeBase(knowledgeBase); assertTrue(vKB.hasData()); }
@Test public void hasData_onlyAliasedPredicates_returnsTrue() { knowledgeBase.addStatement(rule); knowledgeBase.addStatement(fact); VLogKnowledgeBase vKB = new VLogKnowledgeBase(knowledgeBase); assertTrue(vKB.hasData()); }
@Test public void hasData_bothUnaliasedAndAliasedPredicates_returnsTrue() { knowledgeBase.addStatement(Expressions.makeFact(q, c)); knowledgeBase.addStatement(rule); knowledgeBase.addStatement(fact); VLogKnowledgeBase vKB = new VLogKnowledgeBase(knowledgeBase); assertTrue(vKB.hasData()); }