public function asListWithPrimitives() { $list = Arrays::asList(new ArrayList('one', 'two', 'three')); $this->assertSubclass($list, 'util.collections.IList'); $this->assertEquals(3, $list->size()); $this->assertEquals('one', $list->get(0)); $this->assertEquals('two', $list->get(1)); $this->assertEquals('three', $list->get(2)); }
private static function formatIllegalArgumentErrorMessage($target, Method $serviceMethod, $args) { $source = self::getSourceRepresentation($serviceMethod); $sb = "Blocked attempt to invoke method '{$source}'"; if (!is_null($target)) { $printedType = self::printTypeName(Classes::classOf($target)); $sb .= " on target '{$printedType}'"; } $sb .= ' with invalid arguments'; if (!is_null($args) && !empty($args)) { $sb .= Arrays::asList($args); } return $sb; }