UimaUtils { public static boolean isMergeDistinctEntities(UimaContext context) { Object value = context.getConfigParameterValue(BaleenHistoryConstants.MERGE_DISTINCT_ENTITIES); if (value == null || !(value instanceof Boolean)) { return false; } else { return (boolean) value; } } private  UimaUtils(); static String getPipelineName(UimaContext context); static boolean isMergeDistinctEntities(UimaContext context); static String makePipelineSpecificName(String pipelineName, Class<?> clazz);  }
@Test public void testIsMergeDistinctEntities() throws ResourceInitializationException { assertFalse(UimaUtils.isMergeDistinctEntities(UimaContextFactory.createUimaContext())); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "null"))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "hello"))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, false))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, Boolean.FALSE))); assertTrue( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, Boolean.TRUE))); assertTrue( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, true))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "false"))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "true"))); }