### Question:
ResolverDataSnapshotList { static boolean shouldResolveOrderBy(Class<?> dataType, DataSnapshot dataSnapshot) { return (ClassReflection.isAssignableFrom(List.class, dataType) || ClassReflection.isAssignableFrom(Map.class, dataType)) && dataSnapshot.getChildrenCount() > 0; } private  ResolverDataSnapshotList();   }### Answer:
@Test public void shouldResolveOrderBy() { Class dataType = List.class; DataSnapshot dataSnapshot = Mockito.mock(DataSnapshot.class); Mockito.when(dataSnapshot.getChildrenCount()).thenReturn(1L); boolean should = ResolverDataSnapshotList.shouldResolveOrderBy(dataType, dataSnapshot); Assert.assertTrue(should); }
@Test public void shouldResolveOrderBy3() { Class dataType = String.class; DataSnapshot dataSnapshot = Mockito.mock(DataSnapshot.class); Mockito.when(dataSnapshot.getChildrenCount()).thenReturn(1L); boolean should = ResolverDataSnapshotList.shouldResolveOrderBy(dataType, dataSnapshot); Assert.assertFalse(should); }
@Test public void shouldResolveOrderBy4() { Class dataType = String.class; DataSnapshot dataSnapshot = Mockito.mock(DataSnapshot.class); Mockito.when(dataSnapshot.getChildrenCount()).thenReturn(0L); boolean should = ResolverDataSnapshotList.shouldResolveOrderBy(dataType, dataSnapshot); Assert.assertFalse(should); }