T[] (@NotNull Class<?> aClass, @Nullable List<T> result) { T[] value; if (result == null) { myMap.put(aClass, myEmptyArray); value = null; } else { assert !result.isEmpty(); value = result.toArray(myEmptyArray); myMap.put(aClass, value); } return value; }