minor java collections work
This commit is contained in:
parent
22ebf4a218
commit
62fd8f8978
|
@ -35,6 +35,13 @@ public class CoreJavaUnitTest {
|
|||
unmodifiableList.add("four");
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public final void givenUsingGuavaBuilder_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() {
|
||||
final List<String> list = new ArrayList<String>(Arrays.asList("one", "two", "three"));
|
||||
final ImmutableList<Object> unmodifiableList = ImmutableList.builder().addAll(list).build();
|
||||
unmodifiableList.add("four");
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public final void givenUsingCommonsCollections_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() {
|
||||
final List<String> list = new ArrayList<String>(Arrays.asList("one", "two", "three"));
|
||||
|
|
Loading…
Reference in New Issue