LazyBindingList extends AbstractList<E> implements Immutable, RandomAccess { static <E extends DataObject> @NonNull List<E> create(final ListNodeCodecContext<E> codec, final int size, final Collection<? extends NormalizedNodeContainer<?, ?, ?>> entries) { if (size == 1) { return List.of(codec.createBindingProxy(entries.iterator().next())); } return size > LAZY_CUTOFF ? new LazyBindingList<>(codec, entries) : eagerList(codec, size, entries); } private  LazyBindingList(final ListNodeCodecContext<E> codec,
            final Collection<? extends NormalizedNodeContainer<?, ?, ?>> entries); @Override int size(); @Override E get(final int index); @Override @SuppressWarnings("checkstyle:parameterName") boolean remove(final Object o); @Override @SuppressWarnings("checkstyle:parameterName") boolean addAll(final Collection<? extends E> c); @Override @SuppressWarnings("checkstyle:parameterName") boolean addAll(final int index, final Collection<? extends E> c); @Override @SuppressWarnings("checkstyle:parameterName") boolean removeAll(final Collection<?> c); @Override @SuppressWarnings("checkstyle:parameterName") boolean retainAll(final Collection<?> c); @Override @SuppressWarnings("checkstyle:parameterName") void sort(final Comparator<? super E> c); @Override void replaceAll(final UnaryOperator<E> operator);  }
@Test public void testSingletonList() { final TopLevelList expected = new TopLevelListBuilder() .setName("test") .setNestedList(List.of(new NestedListBuilder().setName(String.valueOf("one")).build())) .build(); final TopLevelList actual = thereAndBackAgain( InstanceIdentifier.create(Top.class).child(TopLevelList.class, expected.key()), expected); final List<NestedList> list = actual.getNestedList(); assertThat(list, not(instanceOf(LazyBindingList.class))); assertEquals(expected.getNestedList(), list); }