@Test
public void filtering() {

    when(field1.getName()).thenReturn("field1");
    when(field2.getName()).thenReturn("field2");
    final ActionFieldList afl = new ActionInsertFact();
    final ActionFieldValue afv = new ActionFieldValue();
    afv.setField("field1");
    afl.addFieldValue(afv);
    final ModelField[] result = ModelFieldUtil.getAvailableFieldCompletions(new ModelField[]{field1, field2},
                                                                            afl);
    assertEquals(1,
                 result.length);
    assertEquals(field2,
                 result[0]);
}