FactMapping { public List<ExpressionElement> getExpressionElementsWithoutClass() { if (expressionElements.isEmpty()) { throw new IllegalStateException("ExpressionElements malformed"); } return expressionElements.subList(1, expressionElements.size()); } FactMapping();  FactMapping(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier);  FactMapping(String factAlias, FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier); private  FactMapping(FactMapping original); String getFullExpression(); List<ExpressionElement> getExpressionElementsWithoutClass(); List<ExpressionElement> getExpressionElements(); void addExpressionElement(String stepName, String className); String getClassName(); ExpressionIdentifier getExpressionIdentifier(); FactIdentifier getFactIdentifier(); String getFactAlias(); void setFactAlias(String factAlias); String getExpressionAlias(); void setExpressionAlias(String expressionAlias); List<String> getGenericTypes(); void setGenericTypes(List<String> genericTypes); FactMapping cloneFactMapping(); static String getPlaceHolder(FactMappingType factMappingType); static String getPlaceHolder(FactMappingType factMappingType, int index); FactMappingValueType getFactMappingValueType(); void setFactMappingValueType(FactMappingValueType factMappingValueType); static String getInstancePlaceHolder(int index); static String getPropertyPlaceHolder(int index); @Override boolean equals(Object o); @Override int hashCode(); Double getColumnWidth(); void setColumnWidth(Double columnWidth);  }
@Test public void getExpressionElementsWithoutClass() { FactMapping original = new FactMapping("FACT_ALIAS", new FactIdentifier("FI_TEST", "com.test.Foo"), new ExpressionIdentifier("EI_TEST", FactMappingType.GIVEN)); assertThatThrownBy(original::getExpressionElementsWithoutClass) .isInstanceOf(IllegalStateException.class) .hasMessage("ExpressionElements malformed"); assertEquals(0, original.getExpressionElements().size()); original.addExpressionElement("STEP", String.class.getCanonicalName()); assertEquals(0, original.getExpressionElementsWithoutClass().size()); assertEquals(1, original.getExpressionElements().size()); }