LiteralAttribute extends AbstractIndexableAttribute { @Override public Object getValue(int index) { if (index < 0 || index >= values.size()) return null; return values.get(index); } LiteralAttribute(String key, AttributeLevel level); @Override int registerXAttribute(XAttribute attr); @Override ImmutableList<Object> getValues(); @Override int getValueIndex(Object value); @Override Object getValue(int index); @Override int getValueSize();  }
@Test public void testGetValue() { LiteralAttribute att1 = this.newWithOneValue("concept:name", AttributeLevel.EVENT); Assert.assertEquals(att1.getValue(0), "test"); Assert.assertEquals(att1.getValue(0), "test"); LiteralAttribute att2 = this.newWithTwoValues("concept:name", AttributeLevel.EVENT); Assert.assertEquals(att2.getValue(0), "test1"); Assert.assertEquals(att2.getValue(1), "test2"); }
@Test public void testGetValueFromEmptyAttribute() { LiteralAttribute att0 = this.newEmptyAttribute("concept:name", AttributeLevel.EVENT); Assert.assertEquals(att0.getValue(0),null); }