@SuppressWarnings({ "rawtypes", "unchecked" })

@Test
void getCollection()
{
    // List
    Collection unsafe = Arrays.asList("1", "2");
    Collection safe = (Collection) this.scriptSafeProvider.get(unsafe);
    assertNotSame(unsafe, safe);
    assertTrue(safe instanceof List);
    assertEquals(unsafe, safe);
    // Set
    unsafe = new LinkedHashSet(Arrays.asList("1", "2", "3", "4", "5"));
    safe = (Collection) this.scriptSafeProvider.get(unsafe);
    assertNotSame(unsafe, safe);
    assertTrue(safe instanceof Set);
    assertEquals(unsafe, safe);
    // Make sure order is kept
    assertEquals(unsafe.toString(), safe.toString());
}