Set<String> fieldNames = new HashSet<String>();
final StajParser stajParser = new StajParser(jsonReader);
while (stajParser.hasNext()) {
JsonStreamElement next = stajParser.next();
if (next.jsonStreamElementType() == JsonStreamElementType.START_FIELD) {
fieldNames.add(next.text());
}
}
assertThat(fieldNames, equalTo((Set<String>) new HashSet<String>(Arrays.asList("name", "sales", "totalRoyalties", "singles"))));
}
}