getOnlyElement should return the only element.