### Question:
TypePrioritiesFactory { @SafeVarargs public static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes) { String[] typeNames = new String[prioritizedTypes.length]; for (int i = 0; i < prioritizedTypes.length; i++) { if (!TOP.class.isAssignableFrom(prioritizedTypes[i])) { throw new IllegalArgumentException("[" + prioritizedTypes[i] + "] is not a JCas type"); } String typeName = prioritizedTypes[i].getName(); if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) { typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length()); } typeNames[i] = typeName; } return createTypePriorities(typeNames); } private  TypePrioritiesFactory(); @SafeVarargs static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes); static TypePriorities createTypePriorities(String... prioritizedTypeNames); static TypePriorities createTypePriorities(); static String[] scanTypePrioritiesDescriptors(); static void forceTypePrioritiesDescriptorsScan();  }### Answer:
@Test public void testCreateTypePrioritiesFromTypeNames() throws Exception { TypePriorities prio = createTypePriorities(CAS.TYPE_NAME_ANNOTATION); CasCreationUtils.createCas(createTypeSystemDescription(), prio, null); assertThat(prio.getPriorityLists()).hasSize(1); assertThat(prio.getPriorityLists()[0].getTypes()).containsExactly(CAS.TYPE_NAME_ANNOTATION); }
@Test public void testCreateTypePrioritiesFromClasses() throws Exception { TypePriorities prio = createTypePriorities(Annotation.class); CasCreationUtils.createCas(createTypeSystemDescription(), prio, null); assertThat(prio.getPriorityLists()).hasSize(1); assertThat(prio.getPriorityLists()[0].getTypes()).containsExactly(CAS.TYPE_NAME_ANNOTATION); }
@Test(expected = IllegalArgumentException.class) public void testCreateTypePrioritiesFromBadClasses() throws Exception { TypePriorities prio = createTypePriorities((Class) Integer.class); }
@Test public void testAutoDetectTypePriorities() throws Exception { TypePriorities prio = createTypePriorities(); TypePriorityList[] typePrioritiesLists = prio.getPriorityLists(); assertThat(typePrioritiesLists.length).isEqualTo(1); assertThat(typePrioritiesLists[0].getTypes()) .as("Type priorities auto-detection") .containsExactly(Sentence.class.getName(), Token.class.getName()); }