@SuppressWarnings({ "rawtypes", "unchecked" }) @Test void getCollection() { Collection unsafe = Arrays.asList("1", "2"); Collection safe = (Collection) this.scriptSafeProvider.get(unsafe); assertNotSame(unsafe, safe); assertTrue(safe instanceof List); assertEquals(unsafe, safe); 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); assertEquals(unsafe.toString(), safe.toString()); }
@Override public Object get(Object unsafe) { if (unsafe == null) { return null; } Object safe = get(unsafe, Arrays.<Type>asList(unsafe.getClass())); if (safe == null) { safe = unsafe; } return safe; }
DefaultScriptSafeProvider implements ScriptSafeProvider { @Override public Object get(Object unsafe) { if (unsafe == null) { return null; } Object safe = get(unsafe, Arrays.<Type>asList(unsafe.getClass())); if (safe == null) { safe = unsafe; } return safe; } }
DefaultScriptSafeProvider implements ScriptSafeProvider { @Override public Object get(Object unsafe) { if (unsafe == null) { return null; } Object safe = get(unsafe, Arrays.<Type>asList(unsafe.getClass())); if (safe == null) { safe = unsafe; } return safe; }  }
DefaultScriptSafeProvider implements ScriptSafeProvider { @Override public Object get(Object unsafe) { if (unsafe == null) { return null; } Object safe = get(unsafe, Arrays.<Type>asList(unsafe.getClass())); if (safe == null) { safe = unsafe; } return safe; }  @Override Object get(Object unsafe); }
DefaultScriptSafeProvider implements ScriptSafeProvider { @Override public Object get(Object unsafe) { if (unsafe == null) { return null; } Object safe = get(unsafe, Arrays.<Type>asList(unsafe.getClass())); if (safe == null) { safe = unsafe; } return safe; }  @Override Object get(Object unsafe);  }