### Question:
Auth implements AuthDistribution { @Override public Promise<GdxFirebaseUser> signInWithEmailAndPassword(String email, char[] password) { return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().signInWithEmailAndPassword(email, new String(password)))); }  @Override GdxFirebaseUser getCurrentUser(); @Override Promise<GdxFirebaseUser> createUserWithEmailAndPassword(String email, char[] password); @Override Promise<GdxFirebaseUser> signInWithEmailAndPassword(String email, char[] password); @Override Promise<GdxFirebaseUser> signInWithToken(String token); @Override Promise<GdxFirebaseUser> signInAnonymously(); @Override Promise<Void> signOut(); @Override Promise<Void> sendPasswordResetEmail(final String email);  }### Answer:
@Test public void signInWithEmailAndPassword() { Auth auth = new Auth(); Consumer consumer = Mockito.mock(Consumer.class); Mockito.when(task.isSuccessful()).thenReturn(true); Mockito.doReturn(task).when(firebaseAuth).signInWithEmailAndPassword(Mockito.anyString(), Mockito.anyString()); auth.signInWithEmailAndPassword("user", "password".toCharArray()) .then(consumer); PowerMockito.verifyStatic(FirebaseAuth.class, VerificationModeFactory.times(2)); FirebaseAuth.getInstance(); Mockito.verify(firebaseAuth, VerificationModeFactory.times(1)).signInWithEmailAndPassword(Mockito.eq("user"), Mockito.eq("password")); Mockito.verify(task, VerificationModeFactory.times(1)).addOnCompleteListener(Mockito.any(OnCompleteListener.class)); Mockito.verify(firebaseAuth, VerificationModeFactory.times(1)).getCurrentUser(); Mockito.verify(consumer, VerificationModeFactory.times(1)).accept(Mockito.any(GdxFirebaseUser.class)); }
@Test public void signInWithEmailAndPassword_fail() { Auth auth = new Auth(); BiConsumer biConsumer = Mockito.mock(BiConsumer.class); Mockito.when(task.isSuccessful()).thenReturn(false); Mockito.when(task.getException()).thenReturn(new Exception()); Mockito.doReturn(task).when(firebaseAuth).signInWithEmailAndPassword(Mockito.anyString(), Mockito.anyString()); auth.signInWithEmailAndPassword("user", "password".toCharArray()) .fail(biConsumer); PowerMockito.verifyStatic(FirebaseAuth.class, VerificationModeFactory.times(1)); FirebaseAuth.getInstance(); Mockito.verify(firebaseAuth, VerificationModeFactory.times(1)).signInWithEmailAndPassword(Mockito.eq("user"), Mockito.eq("password")); Mockito.verify(task, VerificationModeFactory.times(1)).addOnCompleteListener(Mockito.any(OnCompleteListener.class)); Mockito.verify(biConsumer, VerificationModeFactory.times(1)).accept(Mockito.nullable(String.class), Mockito.any(Exception.class)); }